nginx配置
server {
listen 80;
server_name localhost;
#access_log /var/log/nginx/host.access.log main;
location / {
root /usr/share/nginx/html;
index index.html index.htm;
#解决vue history方式刷新浏览器URL页面404问题
try_files $uri $uri/ /index.html;
}
}
nginx docker-compose.yml
version: "3"
services:
web:
image: nginx
container_name: nginx
volumes:
- ./conf.d:/etc/nginx/conf.d
- ./html:/usr/share/nginx/html
ports:
- 80:80
https://www.leftso.com/article/934.html