最详细nginx反向代理之端口配置


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 {
}
}




。。。。。。。。。。。。。

作者:Vam的金豆之路

篇幅有限更多请见扩展链接:http://www.mark-to-win.com/tutorial/50975.html

发表评论
留言与评论(共有 0 条评论) “”
   
验证码:

相关文章

推荐文章