# HTTPS server
server {
listen 443;
server_name ************.com;
ssl on;
ssl_certificate cert/************.com.pem;
ssl_certificate_key cert/************.com.key;
ssl_session_timeout 5m;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE:ECDH:AES:HIGH:!NULL:!aNULL:!MD5:!ADH:!RC4;
ssl_prefer_server_ciphers on;
location / {
root /usr/local/web/AAAA;
index index.html index.htm;
}
root /usr/local/web;
location /BBBBB{
index index.html index.htm;
}
####重點###當在BBBB專案里后端代理路徑就是以BBBB開頭了,只配置/api
代理路徑請求后端會報404,需要在配置/BBBBB/api的代理
location /BBBBB/api {#這里是核心,與開發環境中代理路徑一定要保持一致
proxy_set_header Host $host;
proxy_set_header x-forwarded-for $remote_addr;
proxy_set_header X-Real-IP $remote_addr;
proxy_pass http://************:8080/api;#后臺的介面
}
####后端代理路徑地址 ‘/api開頭的都走這個代理’
location /api {#這里是核心,與開發環境中代理路徑一定要保持一致
proxy_set_header Host $host;
proxy_set_header x-forwarded-for $remote_addr;
proxy_set_header X-Real-IP $remote_addr;
proxy_pass http://************:8080;#后臺的介面
}
}
————————————————
著作權宣告:本文為CSDN博主「一程式一世界」的原創文章,遵循CC 4.0 BY-SA著作權協議,轉載請附上原文出處鏈接及本宣告,
原文鏈接:https://blog.csdn.net/Hello_word_2/article/details/128057295
搜索
復制
轉載請註明出處,本文鏈接:https://www.uj5u.com/qiye/538479.html
標籤:其他
上一篇:ES6
下一篇:本地JS檔案批量壓縮
