2025-03-19 15:04:57 +08:00

28 lines
1.6 KiB
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

server {
# 根据实际需要将端口改回成80 or 443改为443要https证书同时将cloud-multishop.mall4j.com改成真正的域名 443端口的配置参考cloud-api
listen 80;
server_name multishop.mall4j.com;
location / {
# 商家端vue项目的路径存放到这里 /usr/share/nginx/html/cloud-multishop
# 1.如果是docker部署的nginx那么这个路径是docker里面的路径
# 服务器上的物理路径应该是 在docker-compose下的mall4j-nginx映射下 “./nginx/html:/usr/share/nginx/html” 也就是docker-compose的相对路径下的nginx/html文件夹
# 2. 如果是非docker部署就是服务器的物理路径
# 如果location是/那么root就要对应的代码路径咯
# 如果location是/multishop那么这个root就可以不用/multishop了也就是/usr/share/nginx/html
root /usr/share/nginx/html/multishop;
add_header Cache-Control "no-store";
add_header Strict-Transport-Security "max-age=63072000; includeSubdomains; preload";
add_header X-Frame-Options "SAMEORIGIN";
add_header X-XSS-Protection "1; mode=block";
add_header X-Content-Type-Options "nosniff";
# 如果觉得有必要的话可以增加Content-Security-Policy不过里面的域名要自己确定增加哪些
# add_header Content-Security-Policy "default-src 'self' https://cloud-api.mall4j.com wss://cloud-api.mall4j.com;img-src 'self' https://mall4cloud.oss-cn-guangzhou.aliyuncs.com data: blob:; style-src 'self' 'unsafe-inline';script-src 'self' 'unsafe-inline'";
}
}