151 lines
4.2 KiB
Plaintext
151 lines
4.2 KiB
Plaintext
# 杜康好客 — runxian.top HTTPS(证书申请后启用)
|
|
# 执行: deploy/enable-runxian-dukang-ssl.sh
|
|
|
|
map $host $dukang_runxian_port {
|
|
user.runxian.top 8091;
|
|
shop.runxian.top 8092;
|
|
partner.runxian.top 8093;
|
|
webadmin.runxian.top 8094;
|
|
}
|
|
|
|
server {
|
|
listen 80;
|
|
server_name user.runxian.top shop.runxian.top partner.runxian.top;
|
|
|
|
location ^~ /.well-known/acme-challenge/ {
|
|
root /var/www/certbot;
|
|
default_type "text/plain";
|
|
}
|
|
|
|
location ~ ^/MP_verify_.*\.txt$ {
|
|
root /opt/dukang-haoke/apps/h5-user/dist;
|
|
default_type text/plain;
|
|
access_log off;
|
|
}
|
|
|
|
location / {
|
|
return 301 https://$host$request_uri;
|
|
}
|
|
}
|
|
|
|
server {
|
|
listen 443 ssl;
|
|
server_name user.runxian.top shop.runxian.top partner.runxian.top;
|
|
|
|
access_log /var/log/nginx/dukang/runxian-h5.access.log main;
|
|
error_log /var/log/nginx/dukang/runxian-h5.error.log warn;
|
|
|
|
ssl_certificate /etc/letsencrypt/live/user.runxian.top/fullchain.pem;
|
|
ssl_certificate_key /etc/letsencrypt/live/user.runxian.top/privkey.pem;
|
|
ssl_protocols TLSv1.2 TLSv1.3;
|
|
ssl_prefer_server_ciphers on;
|
|
|
|
client_max_body_size 20m;
|
|
|
|
location /api/ {
|
|
proxy_pass http://127.0.0.1:8090;
|
|
proxy_http_version 1.1;
|
|
proxy_set_header Host $host;
|
|
proxy_set_header X-Real-IP $remote_addr;
|
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
proxy_set_header X-Forwarded-Proto $scheme;
|
|
proxy_set_header Connection "";
|
|
}
|
|
|
|
location / {
|
|
proxy_pass http://127.0.0.1:$dukang_runxian_port;
|
|
proxy_http_version 1.1;
|
|
proxy_set_header Host $host;
|
|
proxy_set_header X-Real-IP $remote_addr;
|
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
proxy_set_header X-Forwarded-Proto $scheme;
|
|
}
|
|
}
|
|
|
|
server {
|
|
listen 80;
|
|
server_name dkapi.runxian.top;
|
|
|
|
location ^~ /.well-known/acme-challenge/ {
|
|
root /var/www/certbot;
|
|
default_type "text/plain";
|
|
}
|
|
|
|
location / {
|
|
return 301 https://$host$request_uri;
|
|
}
|
|
}
|
|
|
|
server {
|
|
listen 443 ssl;
|
|
server_name dkapi.runxian.top;
|
|
|
|
access_log /var/log/nginx/dukang/runxian-api.access.log main;
|
|
error_log /var/log/nginx/dukang/runxian-api.error.log warn;
|
|
|
|
ssl_certificate /etc/letsencrypt/live/user.runxian.top/fullchain.pem;
|
|
ssl_certificate_key /etc/letsencrypt/live/user.runxian.top/privkey.pem;
|
|
ssl_protocols TLSv1.2 TLSv1.3;
|
|
ssl_prefer_server_ciphers on;
|
|
|
|
client_max_body_size 20m;
|
|
|
|
location / {
|
|
proxy_pass http://127.0.0.1:8090;
|
|
proxy_http_version 1.1;
|
|
proxy_set_header Host $host;
|
|
proxy_set_header X-Real-IP $remote_addr;
|
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
proxy_set_header X-Forwarded-Proto $scheme;
|
|
proxy_set_header Connection "";
|
|
}
|
|
}
|
|
|
|
server {
|
|
listen 80;
|
|
server_name webadmin.runxian.top;
|
|
|
|
location ^~ /.well-known/acme-challenge/ {
|
|
root /var/www/certbot;
|
|
default_type "text/plain";
|
|
}
|
|
|
|
location / {
|
|
return 301 https://$host$request_uri;
|
|
}
|
|
}
|
|
|
|
server {
|
|
listen 443 ssl;
|
|
server_name webadmin.runxian.top;
|
|
|
|
access_log /var/log/nginx/dukang/runxian-admin.access.log main;
|
|
error_log /var/log/nginx/dukang/runxian-admin.error.log warn;
|
|
|
|
ssl_certificate /etc/letsencrypt/live/user.runxian.top/fullchain.pem;
|
|
ssl_certificate_key /etc/letsencrypt/live/user.runxian.top/privkey.pem;
|
|
ssl_protocols TLSv1.2 TLSv1.3;
|
|
ssl_prefer_server_ciphers on;
|
|
|
|
client_max_body_size 20m;
|
|
|
|
location /api/ {
|
|
proxy_pass http://127.0.0.1:8090;
|
|
proxy_http_version 1.1;
|
|
proxy_set_header Host $host;
|
|
proxy_set_header X-Real-IP $remote_addr;
|
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
proxy_set_header X-Forwarded-Proto $scheme;
|
|
proxy_set_header Connection "";
|
|
}
|
|
|
|
location / {
|
|
proxy_pass http://127.0.0.1:8094;
|
|
proxy_http_version 1.1;
|
|
proxy_set_header Host $host;
|
|
proxy_set_header X-Real-IP $remote_addr;
|
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
proxy_set_header X-Forwarded-Proto $scheme;
|
|
}
|
|
}
|