簡體   English   中英

在多個端口上偵聽並將端口映射到另一個域

[英]listen on more than one port and map port to another domain

Blow是我當前運行nginx,gunicorn和Django的服務器的配置。 所有這一切。 但是,我添加了一些在端口5555上運行的監視應用程序。如何授予訪問權限?

是否添加其他監聽設置,可以將其映射到另一個域?

upstream app_server_djangoapp {
    server localhost:8002 fail_timeout=0;
}

server {
    #EC2 instance security group must be configured to accept http connections over Port 80
    listen 80;
    server_name testdomain.com;

    access_log  /var/log/nginx/guni-access.log;
    error_log  /var/log/nginx/guni-error.log info;

    keepalive_timeout 5;

    # Size in megabytes to allow for uploads.
    client_max_body_size 20M;

    # path for static files
    root /home/username/webapps/guni/static;

    location /docs/  {
                autoindex on;
                alias /srv/site/docs/buildHTML/html/;
    }



    location / {
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header Host $http_host;
        proxy_redirect off;

        if (!-f $request_filename) {
            proxy_pass http://app_server_djangoapp;
            break;
        }
    }
}

這是一個基本塊,它將使yourdomain.tld指向監視應用程序:

server {
    listen 80;
    server_name yourdomain.tld;
    location / {
        proxy_pass http://ip-of-probably-flower-server:5555;
        }

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM