如何配置nginx.org作为渡槽服务器的代理服务器?
How to configure nginx.org as proxy server for aqueduct server?
我的 aqueduct 服务器正在 ubuntu 18.04 (http://127.0.0.1:8888) 上工作。我从 nginx.org 安装 nginx。目前我在 nginx 上的渡槽没有使用任何块。我修改了默认配置,例如我将我的域名添加到其中。而且我的 aqueduct 服务器和 nginx 服务器都在工作。
我的问题是如何配置我的 nginx 以便我可以使用反向代理选项,这样我就不会直接连接到我的 aqueduct 服务器。有什么帮助吗?
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/;
}
}
好的。我找到了。我在可用站点和已启用站点中使用 default.conf。这是修改 default.conf 的错误位置。正确的路径是在 conf.d 目录中修改 default.conf。
1) 安装nginx
2) 运行:
nginx -v
(nginx 版本:nginx/1.15.5)
3) 须藤纳米 /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 重新加载 nginx
5) sudo systemctl 重启 nginx
6) 须藤 nginx -t
7) 卷曲 http://your_domain_name/
我的 aqueduct 服务器正在 ubuntu 18.04 (http://127.0.0.1:8888) 上工作。我从 nginx.org 安装 nginx。目前我在 nginx 上的渡槽没有使用任何块。我修改了默认配置,例如我将我的域名添加到其中。而且我的 aqueduct 服务器和 nginx 服务器都在工作。
我的问题是如何配置我的 nginx 以便我可以使用反向代理选项,这样我就不会直接连接到我的 aqueduct 服务器。有什么帮助吗?
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/;
}
}
好的。我找到了。我在可用站点和已启用站点中使用 default.conf。这是修改 default.conf 的错误位置。正确的路径是在 conf.d 目录中修改 default.conf。
1) 安装nginx
2) 运行:
nginx -v
(nginx 版本:nginx/1.15.5)
3) 须藤纳米 /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 重新加载 nginx 5) sudo systemctl 重启 nginx 6) 须藤 nginx -t 7) 卷曲 http://your_domain_name/