加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
nginx.conf.bak 2.04 KB
一键复制 编辑 原始数据 按行查看 历史
server {
listen 80;
server_name {server_name};
location / {
root {root_path};
index index.html index.htm;
try_files $uri $uri/ /index.html;
}
location /admin {
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Real-Port $remote_port;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass http://127.0.0.1:{port}/admin;
}
location /api {
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Real-Port $remote_port;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass http://127.0.0.1:{port}/api;
}
}
# ssl config
server {
#SSL 访问端口号为 443
listen 443 ssl;
#填写绑定证书的域名
server_name {server_name};
ssl_certificate {ssl_certificate};
ssl_certificate_key {ssl_certificate_key};
ssl_session_timeout 5m;
#请按照以下协议配置
ssl_protocols TLSv1.2 TLSv1.3;
#请按照以下套件配置,配置加密套件,写法遵循 openssl 标准。
ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:HIGH:!aNULL:!MD5:!RC4:!DHE;
ssl_prefer_server_ciphers on;
location / {
root {root_path};
index index.html index.htm;
try_files $uri $uri/ /index.html;
}
location /admin {
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Real-Port $remote_port;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass http://127.0.0.1:{port}/admin;
}
location /api {
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Real-Port $remote_port;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass http://127.0.0.1:{port}/api;
}
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化