60 lines
1.7 KiB
Plaintext
60 lines
1.7 KiB
Plaintext
|
server {
|
||
|
server_name www.jwanfs.3000y.cloud;
|
||
|
listen 18002 ssl;
|
||
|
index index.jsp;
|
||
|
|
||
|
ssl_certificate /etc/jwanfs/ca/jwanfs.crt;
|
||
|
ssl_certificate_key /etc/jwanfs/ca/jwanfs.crt;
|
||
|
|
||
|
location / {
|
||
|
proxy_set_header HOST $host;
|
||
|
proxy_set_header X-Real-IP $remote_addr;
|
||
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||
|
proxy_set_header X-Forwarded-Proto $scheme;
|
||
|
if ($scheme = 'https') {
|
||
|
proxy_pass http://127.0.0.1:18222;
|
||
|
break;
|
||
|
}
|
||
|
try_files $uri $uri/ @http_to_https;
|
||
|
index index.jsp;
|
||
|
}
|
||
|
|
||
|
location @http_to_https {
|
||
|
proxy_set_header Host $host:$server_port;
|
||
|
proxy_set_header X-Real-IP $remote_addr;
|
||
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||
|
proxy_set_header X-Forwarded-Proto $scheme;
|
||
|
return 301 https://www.jwanfs.3000y.cloud:18002/$request_uri;
|
||
|
}
|
||
|
}
|
||
|
|
||
|
server {
|
||
|
server_name www.jwanfs.3000y.cloud;
|
||
|
listen 18001 ssl;
|
||
|
index index.jsp;
|
||
|
|
||
|
ssl_certificate /root/card/server.crt;
|
||
|
ssl_certificate_key /root/card/server.key;
|
||
|
|
||
|
location / {
|
||
|
proxy_set_header HOST $host;
|
||
|
proxy_set_header X-Real-IP $remote_addr;
|
||
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||
|
proxy_set_header X-Forwarded-Proto $scheme;
|
||
|
if ($scheme = 'https') {
|
||
|
proxy_pass http://127.0.0.1:18111;
|
||
|
break;
|
||
|
}
|
||
|
try_files $uri $uri/ @http_to_https;
|
||
|
index index.jsp;
|
||
|
}
|
||
|
|
||
|
location @http_to_https {
|
||
|
proxy_set_header Host $host:$server_port;
|
||
|
proxy_set_header X-Real-IP $remote_addr;
|
||
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||
|
proxy_set_header X-Forwarded-Proto $scheme;
|
||
|
return 301 https://www.jwanfs.3000y.cloud:18001/$request_uri;
|
||
|
}
|
||
|
}
|