Nginx does redirect, not proxy

后端 未结 3 1938
面向向阳花
面向向阳花 2021-01-01 10:10

I want to set up Nginx as a reverse proxy for a https service, because we have a special usecase where we need to \"un-https\" a connection:

http://nginx_serve

3条回答
  •  耶瑟儿~
    2021-01-01 10:39

    You can setup nginx like this if you do not want the server to do redirects:

    server
    {
        listen 80;
        server_name YOUR.OWN.DOMAIN.URL;
        location / {
            proxy_pass http://THE.SITE.URL.YOU.WANT.TO.DELEGAGE/;
            proxy_redirect off;
            proxy_set_header X-Real-IP $remote_addr;
            proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        }
    }
    

提交回复
热议问题