The system with an interface all uses http requests. Now I like to use ssl for URLs with login passwd. For example, when the app calls os.test.com/a/p/login, it uses https requests but other requests. I still use http requests. Now I use openssl to configure the certificate private key, etc. But now every request uses https requests, such as
server {
listen 443;
server_name os.test.com;
ssl on;
ssl_certificate /etc/ngx/conf.d/server.crt;
ssl_certificate_key /etc/ngx/conf.d/server.key;
location / {
proxy_pass http://127.0.0.1:9988;
}
}
How should I modify this
You have to write it separately. First create a server to specifically handle https requests, and then reverse proxy it based on the URL. Here is the code:
Handle non-https requests, https requests are reverse-proxyed out
server {
}
Handling https requests
server{
}