Skip to content

Commit

Permalink
fix nginx refresh 404 issue
Browse files Browse the repository at this point in the history
  • Loading branch information
Harold-y committed Feb 24, 2024
1 parent 655b523 commit e97edbb
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 1 deletion.
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,11 @@ Frontend: Vue3 (new version of frontend) + Naive UI
root@cbr-gov-frostland1-dev:/test/photoly$ > docker-compose up
```

*Note: the initial MySQL will take longer to execute the initialization ("photoly\database\mysql-dump"), and the data will persist to ("photoly\database\mysql-data"). Redis data (login tokens) do not persist because we don't have to. In the docker-compose.yml file and two Dockerfiles inside photoly_backend and photoly_frontend_vue, we have defined (hardcoded) the ports, names, etc. so if you just want to conveniently run the photoly, try not to change these settings. However, if you decide to change some settings, make sure to go over photoly_backend\src\main\resources\application.properties, photoly_frontend_vue\.env, photoly_backend\Dockerfile, photoly_frontend_vue\Dockerfile, and .\docker-compose.yml.
*Note: the initial MySQL will take longer to execute the initialization ("photoly\database\mysql-dump"), and the data will persist to ("photoly\database\mysql-data"). Redis data (login tokens) do not persist because we don't have to. In the docker-compose.yml file and two Dockerfiles inside photoly_backend and photoly_frontend_vue, we have defined (hardcoded) the ports, names, etc. so if you just want to conveniently run the photoly, try not to change these settings.



However, if you decide to change some settings, make sure to go over photoly_backend\src\main\resources\application.properties, photoly_frontend_vue\.env, photoly_backend\Dockerfile, photoly_frontend_vue\Dockerfile, photoly_frontend_vue\nginx_conf, and .\docker-compose.yml.

### Normal VM/Host Version

Expand Down
2 changes: 2 additions & 0 deletions photoly_frontend_vue/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,6 @@ RUN rm -rf ./*

COPY --from=builder /app/dist .

COPY ./nginx.conf /etc/nginx/conf.d/default.conf

ENTRYPOINT ["nginx", "-g", "daemon off;"]
8 changes: 8 additions & 0 deletions photoly_frontend_vue/nginx.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@

server {
location / {
root /usr/share/nginx/html/;
index index.html;
try_files $uri $uri/ /index.html;
}
}

0 comments on commit e97edbb

Please sign in to comment.