worker_processes 1;
events {
worker_connections 1024;
}
http {
client_max_body_size 100m;
include mime.types;
default_type application/octet-stream;
#lccess_log logs/access.log main;
sendfile on;
keepalive_timeout 65;
server {
listen 83;
server_name localhost;
location / {
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_set_header X-NginX-Proxy true;
proxy_set_header Connection "";
proxy_http_version 1.1;
proxy_connect_timeout 1;
proxy_send_timeout 30;
proxy_read_timeout 60;
proxy_pass http://localhost:8080;
}
location /api {
proxy_pass http://localhost:8085/;
proxy_set_header Host $http_host;
proxy_cookie_path / /api;
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
}
}
nginx反向代理
最新推荐文章于 2023-10-18 20:25:54 发布