1

何,

下面是我对 nginx 的配置。如果我使用“位置 /”并浏览到 127.0.0.1,我会看到网页。如果我使用“位置 /ph/”,我会得到 404:未找到。如何使用路径?8051 上列出的应用程序是一个 python 旋风应用程序。

http {

upstream frontends {
    server 127.0.0.1:8051;
}

##
# Basic Settings
##

sendfile on;
tcp_nopush on;
tcp_nodelay on;
keepalive_timeout 30;
types_hash_max_size 2048;
# server_tokens off;
# server_names_hash_bucket_size 64;
# server_name_in_redirect off;

include /etc/nginx/mime.types;
default_type application/octet-stream;

    # Only retry if there was a communication error, not a timeout
    # on the Tornado server (to avoid propagating "queries of death"
    # to all frontends)
    proxy_next_upstream error;

server {
    listen   80;
    server_name 127.0.0.1;

            location /ph/ {
        proxy_pass_header Server;
        proxy_set_header Host $http_host;
        proxy_redirect off;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Scheme $scheme;
        proxy_pass http://frontends;
        }
4

0 回答 0