温馨提示:本文共1155个字,读完预计3分钟。
cd /etc/nginx/
vim nginx.conf
server {
listen 80 default_server;
listen [::]:80 default_server;
server_name 域名;
listen 443 ssl;
root /usr/share/nginx/html;
ssl_certificate cert/1_www.maomin.club_bundle.crt;
ssl_certificate_key cert/2_www.maomin.club.key;
ssl_session_timeout 5m;
# Load configuration files for the default server block.
include /etc/nginx/default.d/*.conf;
location / {
root /root/www/;
index index.html index.htm;
}
location /chat/ {
proxy_pass http://内网:3001/;
proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
location /upload/ {
proxy_pass http://内网:8083/;
proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
error_page 404 /404.html;
location = /40x.html {
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
}
}
————————————————
版权声明:本文为CSDN博主「Vam的金豆之路」的原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/qq_39045645/article/details/90029156