106 lines
3.0 KiB
Plaintext
106 lines
3.0 KiB
Plaintext
# 证书申请期间 — lingshivip.cn HTTP(api HTTPS 证书就绪后换 nginx-lingshivip.conf)
|
||
|
||
map $host $dukang_lingshi_port {
|
||
user.lingshivip.cn 8091;
|
||
shop.lingshivip.cn 8092;
|
||
partner.lingshivip.cn 8093;
|
||
admin.lingshivip.cn 8094;
|
||
}
|
||
|
||
server {
|
||
listen 80;
|
||
server_name user.lingshivip.cn shop.lingshivip.cn partner.lingshivip.cn;
|
||
|
||
location ^~ /.well-known/acme-challenge/ {
|
||
root /var/www/certbot;
|
||
default_type "text/plain";
|
||
}
|
||
|
||
location / {
|
||
return 301 https://$host$request_uri;
|
||
}
|
||
}
|
||
|
||
server {
|
||
listen 80;
|
||
server_name api.lingshivip.cn;
|
||
|
||
location ^~ /.well-known/acme-challenge/ {
|
||
root /var/www/certbot;
|
||
default_type "text/plain";
|
||
}
|
||
|
||
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 admin.lingshivip.cn;
|
||
|
||
location ^~ /.well-known/acme-challenge/ {
|
||
root /var/www/certbot;
|
||
default_type "text/plain";
|
||
}
|
||
|
||
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;
|
||
}
|
||
}
|
||
|
||
server {
|
||
listen 443 ssl;
|
||
server_name user.lingshivip.cn shop.lingshivip.cn partner.lingshivip.cn;
|
||
|
||
access_log /var/log/nginx/dukang/lingshi.access.log main;
|
||
error_log /var/log/nginx/dukang/lingshi.error.log warn;
|
||
|
||
ssl_certificate /etc/letsencrypt/live/user.lingshivip.cn/fullchain.pem;
|
||
ssl_certificate_key /etc/letsencrypt/live/user.lingshivip.cn/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_lingshi_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;
|
||
}
|
||
}
|