【问题标题】:How to configure nginx.org as proxy server for aqueduct server?如何将 nginx.org 配置为渡槽服务器的代理服务器?
【发布时间】:2018-10-09 09:28:50
【问题描述】:

我的渡槽服务器正在运行 ubuntu 18.04 (http://127.0.0.1:8888)。我从 nginx.org 安装 nginx。目前我在 nginx 上的渡槽没有使用任何块。我修改了默认配置,例如将我的域名添加到其中。而且我的渡槽服务器和 nginx 服务器都在工作。

我的问题是如何配置我的 nginx,以便我可以使用反向代理选项,所以我不直接连接到我的渡槽服务器。有什么帮助吗?

PS。我使用假域名和 ip 来显​​示我的配置设置。

我的 nginx 配置是:

# Default server configuration
# My domain (mobile.niyazitoros.com) ip: 5.5.5.5 // TEST IP
# ------ http://mobile.niyazitoros.com  and http://5.5.5.5  is working.

server {
    listen 80 default_server;
    listen [::]:80 default_server;

       server_name mobile.niyazitoros.com;

#    root /var/www/example.com;
#    index index.html;

    location / {
# My aqueduct server works on 127.0.0.1:8888
               proxy_pass http://127.0.0.1:8888/;
    }
}

【问题讨论】:

标签: nginx dart reverse-proxy aqueduct


【解决方案1】:

好的。我找到了。我在站点可用和站点启用中使用 default.conf。这是修改 default.conf 的错误位置。正确的路径是修改 conf.d 目录中的 default.conf。

1) 安装 nginx 2)运行: nginx -v
(nginx版本:nginx/1.15.5) 3) sudo nano /etc/nginx/conf.d/default.conf

server {
    listen 80;
        listen [::]:80;

        error_log    /var/log/nginx/your_domain_name.error.log debug;
        rewrite_log on;

        server_name your_domain_name;

        location / {
                proxy_pass http://127.0.0.1:8888/;
    }
}

4) sudo systemctl reload nginx 5) sudo systemctl 重启 nginx 6) 须藤 nginx -t 7) 卷曲http://your_domain_name/

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2012-09-13
    • 2019-08-21
    • 2016-05-07
    • 1970-01-01
    • 2011-01-01
    • 2011-02-05
    • 1970-01-01
    • 2010-09-18
    相关资源
    最近更新 更多