湘乡彭于晏学习前端
nginx
2023-03-20nginx1006

nginx反向代理配置端口转发

下面是nginx.conf nginx配置文件

复制
worker_processes auto; events { worker_connections 1024; } http { include /etc/nginx/mime.types; default_type application/octet-stream; sendfile on; #tcp_nopush on; #keepalive_timeout 0; keepalive_timeout 65; #gzip on; client_max_body_size 20m; server { listen 80; server_name xxx.cn; location / { root /etc/nginx/reservation_fe/dist; index index.html index.htm; } #error_page 404 /404.html; # redirect server error pages to the static page /50x.html # error_page 500 502 503 504 /50x.html; location = /50x.html { root html; } } server { listen 443 ssl; server_name xxx.cn; #证书绑定的网站域名 ssl_certificate /etc/nginx/reservation_fe/ncu-serverall-20221027.crt; #证书公钥 ssl_certificate_key /etc/nginx/reservation_fe/ncu-private-20221027.key; #证书私钥 ssl_session_timeout 5m; ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE:ECDH:AES:HIGH:!NULL:!3DES:!aNULL:!MD5:!ADH:!RC4; ssl_protocols TLSv1 TLSv1.1 TLSv1.2; ssl_prefer_server_ciphers on; location / { root /etc/nginx/reservation_fe/dist/; index index.html index.htm; } location ^~ /api/ { proxy_pass http://xxx.xxx.x.xxx:8089/; #后端 } } }
湘乡彭于晏,专注学习web开发
img
img
img
img