You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
123 lines
3.6 KiB
123 lines
3.6 KiB
|
|
worker_processes 1;
|
|
|
|
|
|
|
|
events {
|
|
worker_connections 1024;
|
|
}
|
|
|
|
|
|
http {
|
|
include mime.types;
|
|
default_type application/octet-stream;
|
|
|
|
sendfile on;
|
|
|
|
keepalive_timeout 65;
|
|
client_max_body_size 50m;
|
|
server {
|
|
listen 80;
|
|
server_name localhost;
|
|
|
|
location / {
|
|
root html;
|
|
index index.html index.htm;
|
|
}
|
|
|
|
# 企业端前端静态资源
|
|
location /efcode20-ent-app/ {
|
|
alias C:/Users/Administrator/Desktop/efcode20/zdxt-ent-app/;
|
|
index index.html;
|
|
try_files $uri $uri/ /efcode20-ent-app/index.html;
|
|
}
|
|
|
|
# 执法端前端静态资源
|
|
location /efcode20-enf-app/ {
|
|
alias C:/Users/Administrator/Desktop/efcode20/zdxt-enf-app/;
|
|
index index.html;
|
|
try_files $uri $uri/ /efcode20-enf-app/index.html;
|
|
}
|
|
|
|
# 监督端前端静态资源
|
|
location /efcode20-sup-web/ {
|
|
alias C:/Users/Administrator/Desktop/efcode20/zdxt-sup-web/;
|
|
index index.html;
|
|
try_files $uri $uri/ /efcode20-sup-web/index.html;
|
|
}
|
|
|
|
# 企业端和执法端
|
|
# 后端API代理(匹配前端 VITE_BASE_URL = '/api/ent-ep')
|
|
location ^~ /efcode20-ent-app/api/ent-ep/ {
|
|
proxy_set_header Host $http_host;
|
|
proxy_set_header X-Real-IP $remote_addr;
|
|
proxy_set_header REMOTE-HOST $remote_addr;
|
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
proxy_read_timeout 86400s;
|
|
proxy_http_version 1.1;
|
|
proxy_set_header Upgrade $http_upgrade;
|
|
proxy_set_header Connection upgrade;
|
|
proxy_buffering off;
|
|
proxy_cache off;
|
|
proxy_pass http://127.0.0.1:8080/;
|
|
}
|
|
location ^~ /efcode20-enf-app/api/enf-ep/ {
|
|
proxy_set_header Host $http_host;
|
|
proxy_set_header X-Real-IP $remote_addr;
|
|
proxy_set_header REMOTE-HOST $remote_addr;
|
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
proxy_read_timeout 86400s;
|
|
proxy_http_version 1.1;
|
|
proxy_set_header Upgrade $http_upgrade;
|
|
proxy_set_header Connection upgrade;
|
|
proxy_buffering off;
|
|
proxy_cache off;
|
|
proxy_pass http://127.0.0.1:8080/;
|
|
}
|
|
# 监督端
|
|
location ^~ /efcode20-sup-web/prod-api/ {
|
|
proxy_set_header Host $http_host;
|
|
proxy_set_header X-Real-IP $remote_addr;
|
|
proxy_set_header REMOTE-HOST $remote_addr;
|
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
proxy_read_timeout 86400s;
|
|
proxy_http_version 1.1;
|
|
proxy_set_header Upgrade $http_upgrade;
|
|
proxy_set_header Connection upgrade;
|
|
proxy_buffering off;
|
|
proxy_cache off;
|
|
proxy_pass http://127.0.0.1:8080/;
|
|
}
|
|
location /profile/ {
|
|
proxy_pass http://127.0.0.1:8080/profile/;
|
|
}
|
|
error_page 500 502 503 504 /50x.html;
|
|
location = /50x.html {
|
|
root html;
|
|
}
|
|
|
|
}
|
|
|
|
|
|
# HTTPS server
|
|
#
|
|
#server {
|
|
# listen 443 ssl;
|
|
# server_name localhost;
|
|
|
|
# ssl_certificate cert.pem;
|
|
# ssl_certificate_key cert.key;
|
|
|
|
# ssl_session_cache shared:SSL:1m;
|
|
# ssl_session_timeout 5m;
|
|
|
|
# ssl_ciphers HIGH:!aNULL:!MD5;
|
|
# ssl_prefer_server_ciphers on;
|
|
|
|
# location / {
|
|
# root html;
|
|
# index index.html index.htm;
|
|
# }
|
|
#}
|
|
|
|
}
|
|
|