nginx config

pull/455/head
skiffer-git 2 years ago committed by Xinwei Xiong(cubxxw-openim)
parent 8246d0dd9f
commit 43eb2326d1

@ -11,7 +11,7 @@ upstream im_demo{
server 127.0.0.1:10004; #IM demo登录注册服务器地址 根据部署情况可指定多台
}
upstream storage {
server 127.0.0.1:10005; #MinIO服务器地址 暂时支持1台
server 127.0.0.1:10005; #MinIO服务器地址 暂时支持1台
}
upstream im_admin{
server 127.0.0.1:10006; #IM admin服务器地址 根据部署情况可指定多台
@ -34,26 +34,28 @@ upstream im_open_rtc{
server {
listen 443;
server_name test-web.rentsoft.cn; #1 web im 端 域名
server_name web.rentsoft.cn; #1 web im 端 域名
ssl on;
ssl_certificate /etc/nginx/conf.d/ssl/test-web.rentsoft.cn.crt; #2 证书
ssl_certificate_key /etc/nginx/conf.d/ssl/test-web.rentsoft.cn.key; #3 证书
ssl_certificate /etc/nginx/conf.d/ssl/web.rentsoft.cn.crt; #2 证书
ssl_certificate_key /etc/nginx/conf.d/ssl/web.rentsoft.cn.key; #3 证书
ssl_session_timeout 5m;
gzip on;
gzip_min_length 1k;
gzip_min_length 1k;
gzip_buffers 4 16k;
gzip_comp_level 2;
gzip_types text/plain application/javascript application/x-javascript text/css application/xml text/javascript application/x-httpd-php image/jpeg image/gif image/png;
gzip_types text/plain application/javascript application/x-javascript text/css application/xml text/javascript application/x-httpd-php image/jpeg image/gif image/png application/wasm;
gzip_vary off;
gzip_disable "MSIE [1-6]\.";
error_page 405 =200 $uri;
default_type application/wasm;
location /{ #web demo
proxy_set_header Host $host;
proxy_set_header X-Real-Ip $remote_addr;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header X-NginX-Proxy true;
root /data1/website/web/build/; # web im静态资源存放路径
root /data1/online/Pc-Web-Demo/build/; # web im静态资源存放路径
index index.html;
try_files $uri $uri/ /index.html;
}
@ -110,7 +112,7 @@ server {
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "Upgrade";
proxy_set_header X-real-ip $remote_addr;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_pass http://im_chat/;
}
location ^~/complete_admin/ { #10009 admin
@ -141,17 +143,17 @@ server {
server {
listen 80;
server_name test-web.rentsoft.cn ; #1 web im 端 域名
server_name web.rentsoft.cn ; #1 web im 端 域名
rewrite ^(.*)$ https://${server_name}$1 permanent;
}
server {
ssl_session_timeout 5m;
listen 443;
server_name test-storage.rentsoft.cn; #1 MinIO存储域名
server_name storage.rentsoft.cn; #1 MinIO存储域名
ssl on;
ssl_certificate /etc/nginx/conf.d/ssl/test-storage.rentsoft.cn.crt; #证书
ssl_certificate_key /etc/nginx/conf.d/ssl/test-storage.rentsoft.cn.key; #证书
ssl_certificate /etc/nginx/conf.d/ssl/storage.rentsoft.cn.crt; #证书
ssl_certificate_key /etc/nginx/conf.d/ssl/storage.rentsoft.cn.key; #证书
gzip on;
gzip_min_length 1k;
gzip_buffers 4 16k;
@ -173,10 +175,10 @@ server {
server {
listen 443;
server_name test-admin.rentsoft.cn; #后台管理域名
server_name admin.rentsoft.cn; #后台管理域名
ssl on;
ssl_certificate /etc/nginx/conf.d/ssl/test-admin.rentsoft.cn.crt; # 证书
ssl_certificate_key /etc/nginx/conf.d/ssl/test-admin.rentsoft.cn.key; #证书
ssl_certificate /etc/nginx/conf.d/ssl/admin.rentsoft.cn.crt; # 证书
ssl_certificate_key /etc/nginx/conf.d/ssl/admin.rentsoft.cn.key; #证书
ssl_session_timeout 5m;
gzip on;
gzip_min_length 1k;
@ -190,7 +192,7 @@ server {
proxy_set_header X-Real-Ip $remote_addr;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header X-NginX-Proxy true;
root /data1/website/admin/dist/; #管理后台web静态资源存放路径
root /data1/online/Open-IM-Admin/dist/; #管理后台web静态资源存放路径
index index.html;
try_files $uri $uri/ /index.html;
}
@ -198,6 +200,6 @@ server {
server {
listen 80;
server_name test-admin.rentsoft.cn; #管理后台 域名
server_name admin.rentsoft.cn; #管理后台 域名
rewrite ^(.*)$ https://${server_name}$1 permanent;
}

Loading…
Cancel
Save