Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nginx #69

Open
Triment opened this issue Apr 17, 2023 · 0 comments
Open

nginx #69

Triment opened this issue Apr 17, 2023 · 0 comments

Comments

@Triment
Copy link
Owner

Triment commented Apr 17, 2023

server {
   listen 9090;
   server_name localhost;

   location / {
       #保留代理之前的host 包含客户端真实的域名和端口号
       proxy_set_header    Host  $host; 
       #保留代理之前的真实客户端ip
       proxy_set_header    X-Real-IP  $remote_addr;  
       #这个Header和X-Real-IP类似,但它在多级代理时会包含真实客户端及中间每个代理服务器的IP
       proxy_set_header    X-Forwarded-For  $proxy_add_x_forwarded_for;
       #表示客户端真实的协议(http还是https)
       proxy_set_header X-Forwarded-Proto $scheme;
       #指定修改被代理服务器返回的响应头中的location头域跟refresh头域数值
       #如果使用"default"参数,将根据location和proxy_pass参数的设置来决定。
       #proxy_redirect [ default|off|redirect replacement ];
       proxy_redirect off;
       proxy_pass http://localhost:8090;
   }
}
@Triment Triment changed the title ngainx nginx Apr 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant