Nginx 作为内部转发代理

Nginx as internal forward proxy

这是我的配置:

server {
    listen 172.25.9.64:80;
    server_name www.my-server-name.com;
    root /dev/null;
    return 301 https://www.my-server-name.com$request_uri;
}

limit_conn_zone $server_name zone=data:10m;

server {
    listen 172.25.9.64:443 ssl;
    server_name www.my-server-name.com;
    root /var/www;
    ssl_certificate_key /etc/ssl/server.key;
    ssl_certificate /etc/ssl/server.ca-bundle;

    location / {
        proxy_pass http://172.25.166.68:60936/;
        proxy_redirect default;
        proxy_set_header Host      $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-Host $host;
        proxy_set_header X-Forwarded-Server $host;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        include    /etc/nginx/proxy.conf;
    }
}

你有什么想法吗? 提前谢谢你:)

我只需要将相应的 IP 添加到 /etc/hosts。