#user nobody; worker_processes 1; #error_log logs/error.log; #error_log logs/error.log notice; #error_log logs/error.log info; #pid logs/nginx.pid; events { worker_connections 1024; } http { include mime.types; default_type application/octet-stream; #log_format main ‘$remote_addr - $remote_user [$time_local] "$request" ‘ # ‘$status $body_bytes_sent "$http_referer" ‘ # ‘"$http_user_agent" "$http_x_forwarded_for"‘; #access_log logs/access.log main; sendfile on; #tcp_nopush on; #keepalive_timeout 0; keepalive_timeout 65; #gzip on; #include reverse-procy.conf; server {#vue前端页面访问ip,端口 listen 8090; server_name 10.9.1.179; default_type ‘text/html‘; charset utf-8; location / {#vue项目打包资源路径 root E:/javaworkspace/project/rbApi/dist; index index.html; } location /api/ {#Java后台接口,比如:http://10.9.1.179:8082/api/updateAnnouncement; proxy_pass http://10.9.1.179:8082; } error_page 500 502 503 504 /50x.html; location = /50x.html { root html; } } server {#映射端口Java后台服务器真正的端口 listen 8082; server_name 10.9.1.179; default_type ‘text/html‘; charset utf-8; location / { root html; index getstep.html index.html index.htm; } location /api/ {#Java服务器项目服务地址 proxy_pass http://10.9.1.179:8071; } error_page 500 502 503 504 /50x.html; location = /50x.html { root html; } } }
原文地址:https://www.cnblogs.com/lazyli/p/11165464.html
时间: 2024-11-08 03:33:15