upstream ctlfin_club {
server 172.21.0.4:8080;
}
upstream carkey_club {
server 172.21.16.15:5201;
}
server {
listen 80 ;
listen [::]:80 ;
server_name ctlfin.swmmotors.com.cn;
include /etc/nginx/default.d/*.conf;
location /{
error_log /var/log/nginx/ctlfin_error.log;
access_log /var/log/nginx/ctlfin_access.log main;
proxy_pass http://ctlfin_club/;
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-NginX-Proxy true;
proxy_set_header Connection "";
proxy_http_version 1.1;
proxy_set_header HTTP_X_FORWARDED_FOR $remote_addr;#在多级代理的情况下,记录每次代理之前的客户端真实ip
proxy_redirect default;#指定修改被代理服务器返回的响应头中的location头域跟refresh头域数值
}
location /carkey{
error_log /var/log/nginx/carkey_error.log;
access_log /var/log/nginx/carkey_access.log main;
proxy_pass http://carkey_club/;
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-NginX-Proxy true;
proxy_set_header Connection "";
proxy_http_version 1.1;
proxy_set_header HTTP_X_FORWARDED_FOR $remote_addr;#在多级代理的情况下,记录每次代理之前的客户端真实ip
proxy_redirect default;#指定修改被代理服务器返回的响应头中的location头域跟refresh头域数值
}
error_page 404 /404.html;
location = /40x.html {
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
}
}
# Settings for a TLS enabled server.
#
server {
listen 443 ssl http2 ;
listen [::]:443 ssl http2 ;
server_name ctlfin.swmmotors.com.cn;
ssl_certificate "server.crt";
ssl_certificate_key "server.key";
ssl_session_cache shared:SSL:1m;
ssl_session_timeout 10m;
ssl_ciphers HIGH:!aNULL:!MD5;
ssl_prefer_server_ciphers on;
location /{
proxy_pass http://ctlfin_club/;
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-NginX-Proxy true;
proxy_set_header Connection "";
proxy_http_version 1.1;
proxy_set_header HTTP_X_FORWARDED_FOR $remote_addr;#在多级代理的情况下,记录每次代理之前的客户端真实ip
proxy_redirect default;#指定修改被代理服务器返回的响应头中的location头域跟refresh头域数值
}
location /carkey{
error_log /var/log/nginx/carkey_error.log;
access_log /var/log/nginx/carkey_access.log main;
proxy_pass http://carkey_club/;
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-NginX-Proxy true;
proxy_set_header Connection "";
proxy_http_version 1.1;
proxy_set_header HTTP_X_FORWARDED_FOR $remote_addr;#在多级代理的情况下,记录每次代理之前的客户端真实ip
proxy_redirect default;#指定修改被代理服务器返回的响应头中的location头域跟refresh头域数值
}
error_page 404 /404.html;
location = /40x.html {
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
}
}