我在下面有简单的nginx配置。而不是Nginx将我的请求转发到上游服务器,我得到了一个" pageok"反而回应。
我做错了什么?非常感谢你们。
配置:
server {
proxy_set_header HOST $http_host;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
underscores_in_headers on;
listen 80 default_server;
listen [::]:80 default_server ipv6only=on;
listen 443 ssl;
#root /usr/share/nginx/html;
#index index.html index.htm;
server_name localhost;
ssl_certificate /etc/nginx/ssl/nginx.crt;
ssl_certificate_key /etc/nginx/ssl/nginx.key;
location / {
proxy_pass http://www.upstreamserver.com;
}
}