求路径。
听人劝吃饱饭 2024-04-15 17:27:30不用额外服务器了,都单机了 扛得住 👀️
资源吃紧也可以用其他服务器配负载
搞定了。。谢谢~
火烧云 2024-04-15 15:35:47我是单机部署,需要用另外一台服务器安装 nginx 吗
使用宝塔安装的 nginx 可以吗
不用额外服务器了,都单机了 扛得住 👀️
资源吃紧也可以用其他服务器配负载
听人劝吃饱饭 2024-04-15 14:21:52自己安装,不要用容器配置,也不要用容器去安装
配置自启动,什么的好一些,一般就是 etc 里面的 Nginx 才算对的配置
下面配置供参考
upstream mingdao_http { server 内网明道ip:8880; } # 强制跳转到https访问 server { listen 80; server_name a.com; #改成你的域名 rewrite ^(.*) https://$server_name$request_uri? permanent; access_log /var/log/nginx/a.com.log main; # 日志路径可自定义 error_log /var/log/nginx/a.com.error.log; # 日志路径可自定义 underscores_in_headers on; # 上传文件大小限制 client_max_body_size 2048m; # 开启浏览器压缩,加速请求 gzip on; gzip_proxied any; gzip_disable "msie6"; gzip_vary on; gzip_min_length 512; gzip_comp_level 6; gzip_buffers 16 8k; gzip_types text/plain text/css application/json application/x-javascript application/javascript application/octet-stream text/xml application/xml application/xml+rss text/javascript image/jpeg image/gif image/png; location / { set $real_ip ''; if ($http_x_real_ip) { set $real_ip $http_x_real_ip; } if ($http_x_real_ip = '') { set $real_ip $remote_addr; } proxy_set_header X-Real-IP $real_ip; proxy_set_header Host $host; proxy_set_header X-Forwarded-Proto $scheme; proxy_pass http://mingdao_http; } # IM 需要 location ~ /mds2 { proxy_set_header Host $host; proxy_hide_header X-Powered-By; proxy_set_header X-NginX-Proxy true; proxy_pass http://mingdao_http; proxy_redirect off; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection upgrade; } } server { listen 443 ssl; server_name a.com; #改成你的域名 access_log /var/log/nginx/a.com.log main; # 日志路径可自定义 error_log /var/log/nginx/a.com.error.log; # 日志路径可自定义 ssl_certificate /etc/ssl/a.com.pem; # 修改为你的SSL证书文件路径 ssl_certificate_key /etc/ssl/a.com.key; # 修改为你的SSL证书私钥文件路径 ssl_session_timeout 5m; ssl_protocols TLSv1 TLSv1.1 TLSv1.2; ssl_ciphers AESGCM:ALL:!DH:!EXPORT:!RC4:+HIGH:!MEDIUM:!LOW:!aNULL:!eNULL; ssl_prefer_server_ciphers on; underscores_in_headers on; # 上传文件大小限制 client_max_body_size 2048m; # 开启浏览器压缩,加速请求 gzip on; gzip_proxied any; gzip_disable "msie6"; gzip_vary on; gzip_min_length 512; gzip_comp_level 6; gzip_buffers 16 8k; gzip_types text/plain text/css application/json application/x-javascript application/javascript application/octet-stream text/xml application/xml application/xml+rss text/javascript image/jpeg image/gif image/png; location / { set $real_ip ''; if ($http_x_real_ip) { set $real_ip $http_x_real_ip; } if ($http_x_real_ip = '') { set $real_ip $remote_addr; } if ($request_method = 'OPTIONS') { add_header Access-Control-Allow-Origin '*'; add_header Access-Control-Allow-Headers '*'; add_header Access-Control-Allow-Methods '*'; add_header Access-Control-Allow-Credentials 'true'; return 204; } if ($request_method != 'OPTIONS') { add_header Access-Control-Allow-Origin '*' always; add_header Access-Control-Allow-Credentials 'true'; } proxy_set_header X-Real-IP $real_ip; proxy_set_header Host $host; proxy_set_header X-Forwarded-Proto $scheme; proxy_pass http://mingdao_http; } # IM 需要 location ~ /mds2 { proxy_set_header Host $host; proxy_hide_header X-Powered-By; proxy_set_header X-NginX-Proxy true; proxy_pass http://mingdao_http; proxy_redirect off; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection upgrade; } }
我是单机部署,需要用另外一台服务器安装 nginx 吗
使用宝塔安装的 nginx 可以吗
自己安装,不要用容器配置,也不要用容器去安装
配置自启动,什么的好一些,一般就是 etc 里面的 Nginx 才算对的配置
下面配置供参考
upstream mingdao_http {
server 内网明道ip:8880;
}
# 强制跳转到https访问
server {
listen 80;
server_name a.com; #改成你的域名
rewrite ^(.*) https://$server_name$request_uri? permanent;
access_log /var/log/nginx/a.com.log main; # 日志路径可自定义
error_log /var/log/nginx/a.com.error.log; # 日志路径可自定义
underscores_in_headers on;
# 上传文件大小限制
client_max_body_size 2048m;
# 开启浏览器压缩,加速请求
gzip on;
gzip_proxied any;
gzip_disable "msie6";
gzip_vary on;
gzip_min_length 512;
gzip_comp_level 6;
gzip_buffers 16 8k;
gzip_types text/plain text/css application/json application/x-javascript application/javascript application/octet-stream text/xml application/xml application/xml+rss text/javascript image/jpeg image/gif image/png;
location / {
set $real_ip '';
if ($http_x_real_ip) {
set $real_ip $http_x_real_ip;
}
if ($http_x_real_ip = '') {
set $real_ip $remote_addr;
}
proxy_set_header X-Real-IP $real_ip;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_pass http://mingdao_http;
}
# IM 需要
location ~ /mds2 {
proxy_set_header Host $host;
proxy_hide_header X-Powered-By;
proxy_set_header X-NginX-Proxy true;
proxy_pass http://mingdao_http;
proxy_redirect off;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection upgrade;
}
}
server {
listen 443 ssl;
server_name a.com; #改成你的域名
access_log /var/log/nginx/a.com.log main; # 日志路径可自定义
error_log /var/log/nginx/a.com.error.log; # 日志路径可自定义
ssl_certificate /etc/ssl/a.com.pem; # 修改为你的SSL证书文件路径
ssl_certificate_key /etc/ssl/a.com.key; # 修改为你的SSL证书私钥文件路径
ssl_session_timeout 5m;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_ciphers AESGCM:ALL:!DH:!EXPORT:!RC4:+HIGH:!MEDIUM:!LOW:!aNULL:!eNULL;
ssl_prefer_server_ciphers on;
underscores_in_headers on;
# 上传文件大小限制
client_max_body_size 2048m;
# 开启浏览器压缩,加速请求
gzip on;
gzip_proxied any;
gzip_disable "msie6";
gzip_vary on;
gzip_min_length 512;
gzip_comp_level 6;
gzip_buffers 16 8k;
gzip_types text/plain text/css application/json application/x-javascript application/javascript application/octet-stream text/xml application/xml application/xml+rss text/javascript image/jpeg image/gif image/png;
location / {
set $real_ip '';
if ($http_x_real_ip) {
set $real_ip $http_x_real_ip;
}
if ($http_x_real_ip = '') {
set $real_ip $remote_addr;
}
if ($request_method = 'OPTIONS') {
add_header Access-Control-Allow-Origin '*';
add_header Access-Control-Allow-Headers '*';
add_header Access-Control-Allow-Methods '*';
add_header Access-Control-Allow-Credentials 'true';
return 204;
}
if ($request_method != 'OPTIONS') {
add_header Access-Control-Allow-Origin '*' always;
add_header Access-Control-Allow-Credentials 'true';
}
proxy_set_header X-Real-IP $real_ip;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_pass http://mingdao_http;
}
# IM 需要
location ~ /mds2 {
proxy_set_header Host $host;
proxy_hide_header X-Powered-By;
proxy_set_header X-NginX-Proxy true;
proxy_pass http://mingdao_http;
proxy_redirect off;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection upgrade;
}
}
火烧云 2024-04-15 04:03:56我也是用找到了多个 conf,请问哪个才是?
/var/lib/docker/overlay2/41d6a1e012ab06bf031e3a8ec676e1f318e8741ce638ddb05b296d71a954b4a1/diff/usr/local/nginx/conf/nginx.conf
/var/lib/docker/overlay2/5727ef8013a219335923e70e3194563e76b09e8af3a0871ec55df6277907dc8c/diff/volume/assembly/nginx/config/nginx.conf
/var/lib/docker/overlay2/07dd11edb45273364d7e62d2c9c0f246c063c7428dc57ecc5c89c56f868ed4c8/diff/volume/assembly/nginx/config/nginx.conf
/var/lib/docker/overlay2/46c90b9b69fcd6f8eb14bdf08bf1825b624b4734dab2091f518855a5d4009d49/diff/etc/nginx/nginx.conf
/var/lib/docker/overlay2/038bbb6c4f0cc1898d7398930005a7d8fec231c7d636022affcf69f393ea06fa/diff/etc/nginx/nginx.conf
/var/lib/docker/overlay2/038bbb6c4f0cc1898d7398930005a7d8fec231c7d636022affcf69f393ea06fa/merged/etc/nginx/nginx.conf
/var/lib/docker/overlay2/ebc01c34eff9209be213638287ee10efa92d5ee9a60ab07ef2c9499ebb040d34/diff/usr/local/openresty/nginx/conf/nginx.conf
/var/lib/docker/overlay2/965d8331f5a4c2fb83eaea8b48291bf1d9a801a8bb289a11bcec33bb8e64846d/diff/volume/assembly/nginx/config/nginx.conf
/var/lib/docker/overlay2/340c889e9a0a49a8bd07a35dcdb925f84b3533ca6aa6283bbec47a4886b3d00f/diff/usr/local/nginx/conf/nginx.conf
/var/lib/docker/overlay2/340c889e9a0a49a8bd07a35dcdb925f84b3533ca6aa6283bbec47a4886b3d00f/diff/volume/assembly/nginx/config/nginx.conf
/var/lib/docker/overlay2/056d42576476cfeb471e42dbb2718219e384cd7202076d88711ce1a91eea2b85/merged/volume/assembly/nginx/config/nginx.conf
/var/lib/docker/overlay2/1bf2371254a8fce1d330e119fb7f83515d14b8e4c16f52ff90c4be47b9baf204/merged/volume/assembly/nginx/config/nginx.conf
/var/lib/docker/overlay2/086419d8f54df726787f0cbf9cb19f773b8492d8e75e6345a09feb52f7c30ea5/merged/usr/local/nginx/conf/nginx.conf
/var/lib/docker/overlay2/086419d8f54df726787f0cbf9cb19f773b8492d8e75e6345a09feb52f7c30ea5/merged/usr/local/openresty/nginx/conf/nginx.conf
Nginx 不在单机部署步骤之内,需要额外部署,配置文件参考 https://docs-pd.mingdao.com/deployment/proxy/https 进行配置。
李恩涛(Team) 2021-12-24 18:12:00不同的客户可能搭建的 nginx 的配置文件放置路径不同,可以在安装 nginx 的服务器上进行查找。
命令: find / -name nginx.conf
我也是用找到了多个 conf,请问哪个才是?
/var/lib/docker/overlay2/41d6a1e012ab06bf031e3a8ec676e1f318e8741ce638ddb05b296d71a954b4a1/diff/usr/local/nginx/conf/nginx.conf
/var/lib/docker/overlay2/5727ef8013a219335923e70e3194563e76b09e8af3a0871ec55df6277907dc8c/diff/volume/assembly/nginx/config/nginx.conf
/var/lib/docker/overlay2/07dd11edb45273364d7e62d2c9c0f246c063c7428dc57ecc5c89c56f868ed4c8/diff/volume/assembly/nginx/config/nginx.conf
/var/lib/docker/overlay2/46c90b9b69fcd6f8eb14bdf08bf1825b624b4734dab2091f518855a5d4009d49/diff/etc/nginx/nginx.conf
/var/lib/docker/overlay2/038bbb6c4f0cc1898d7398930005a7d8fec231c7d636022affcf69f393ea06fa/diff/etc/nginx/nginx.conf
/var/lib/docker/overlay2/038bbb6c4f0cc1898d7398930005a7d8fec231c7d636022affcf69f393ea06fa/merged/etc/nginx/nginx.conf
/var/lib/docker/overlay2/ebc01c34eff9209be213638287ee10efa92d5ee9a60ab07ef2c9499ebb040d34/diff/usr/local/openresty/nginx/conf/nginx.conf
/var/lib/docker/overlay2/965d8331f5a4c2fb83eaea8b48291bf1d9a801a8bb289a11bcec33bb8e64846d/diff/volume/assembly/nginx/config/nginx.conf
/var/lib/docker/overlay2/340c889e9a0a49a8bd07a35dcdb925f84b3533ca6aa6283bbec47a4886b3d00f/diff/usr/local/nginx/conf/nginx.conf
/var/lib/docker/overlay2/340c889e9a0a49a8bd07a35dcdb925f84b3533ca6aa6283bbec47a4886b3d00f/diff/volume/assembly/nginx/config/nginx.conf
/var/lib/docker/overlay2/056d42576476cfeb471e42dbb2718219e384cd7202076d88711ce1a91eea2b85/merged/volume/assembly/nginx/config/nginx.conf
/var/lib/docker/overlay2/1bf2371254a8fce1d330e119fb7f83515d14b8e4c16f52ff90c4be47b9baf204/merged/volume/assembly/nginx/config/nginx.conf
/var/lib/docker/overlay2/086419d8f54df726787f0cbf9cb19f773b8492d8e75e6345a09feb52f7c30ea5/merged/usr/local/nginx/conf/nginx.conf
/var/lib/docker/overlay2/086419d8f54df726787f0cbf9cb19f773b8492d8e75e6345a09feb52f7c30ea5/merged/usr/local/openresty/nginx/conf/nginx.conf
贾瑞一 2023-04-29 10:05:27请问一下,您找到 nginx.conf 文件在哪了么?我们前端调用明道云封装业务流程的 API 接口出现了跨域问题,需要在 nginx 的配置文件中加一下跨域的配置。
我重装了 Nginx,然后单独配置了储存位置。 你用 find 看下呢
CHAOHUANG 2021-12-24 21:21:06ok
请问一下,您找到 nginx.conf 文件在哪了么?我们前端调用明道云封装业务流程的 API 接口出现了跨域问题,需要在 nginx 的配置文件中加一下跨域的配置。
李恩涛(Team) 2021-12-24 18:12:00不同的客户可能搭建的 nginx 的配置文件放置路径不同,可以在安装 nginx 的服务器上进行查找。
命令: find / -name nginx.conf
找到好几个 😄
./var/lib/docker/overlay2/2055d6951ae59afa1b2cdf137c7e185b80a62fd4bc581af08772d0fc41c8849a/diff/usr/local/nginx/conf/nginx.conf
./var/lib/docker/overlay2/124bd7f86fc5d076923de0d3de25790cc0e2d629368959605f2fc96fc28c3546/diff/usr/local/openresty/nginx/conf/nginx.conf
./var/lib/docker/overlay2/9ee6b84222d25a91f31b7a2b5f6cd7f699c7d9f08090545c67c51ea703c0aab1/diff/volume/nginx/config/nginx.conf
./var/lib/docker/overlay2/793bff230d20cdd879addbbfe91f52cfa62c5c585e334a43faf5a78a65eae77d/diff/usr/local/nginx/conf/nginx.conf
./var/lib/docker/overlay2/793bff230d20cdd879addbbfe91f52cfa62c5c585e334a43faf5a78a65eae77d/diff/volume/nginx/config/nginx.conf
./var/lib/docker/overlay2/2592fb77ce73404fe40ebe7da1c2b0894d2bb992f43f335bfd6d70db3ee9493a/diff/etc/nginx/nginx.conf
./var/lib/docker/overlay2/ac88ddce91a74bd33676b439b57e4635360b1492c0e66a29fe47358ea8c0207b/diff/etc/nginx/nginx.conf
./var/lib/docker/overlay2/ac88ddce91a74bd33676b439b57e4635360b1492c0e66a29fe47358ea8c0207b/merged/etc/nginx/nginx.conf
./var/lib/docker/overlay2/cf4e99a0f77b185558c509e2c68de5765be75a3127d46119d4dbb5368fe3e597/merged/usr/local/nginx/conf/nginx.conf
./var/lib/docker/overlay2/cf4e99a0f77b185558c509e2c68de5765be75a3127d46119d4dbb5368fe3e597/merged/usr/local/openresty/nginx/conf/nginx.conf
李恩涛(Team) 2021-12-24 18:12:00不同的客户可能搭建的 nginx 的配置文件放置路径不同,可以在安装 nginx 的服务器上进行查找。
命令: find / -name nginx.conf
ok
不同的客户可能搭建的 nginx 的配置文件放置路径不同,可以在安装 nginx 的服务器上进行查找。
命令: find / -name nginx.conf