Comments (3)
Here is an Nginx configuration I had a long time ago, sharing it with you:
server {
server_name ${NGINX_HOST};
listen ${NGINX_PORT};
root /usr/share/nginx/html;
index index.html;
location / {
try_files $uri $uri/ /index.html;
}
location /service-worker.js {
add_header Cache-Control "max-age=0,no-cache,no-store,must-revalidate";
}
client_max_body_size 4G;
keepalive_timeout 10;
}
If you still can't make it work successfully, you can consider downgrading the mode of Vue Router to createWebHashHistory
. This issue pertains to Nginx and SPA (Single Page Application). I will close the issue.
from vue-starter.
You need to configure Single Page Applications in Nginx, and I suppose the possible configuration could be:
location / {
try_files $uri $uri/ /index.html;
}
I personally use Caddy, and below is my configuration:
https://github.com/Shyam-Chen/Vue-Starter/blob/main/Caddyfile#LL6C32-L6C32
from vue-starter.
Thank you for your prompt response.
In fact, I currently have a requirement to integrate the built files into a Java project, which is why I was testing with nginx.
However, after making the modifications based on the configuration values you provided, the situation has now changed to a 500 error. It seems that the situation has worsened.
from vue-starter.
Related Issues (20)
- Lighthouse Test is 0 performance - everything else >= 91 HOT 2
- Automatically build images and push to Docker Cloud
- `firebase serve --only functions --token $FIREBASE_TOKEN` fails with TypeError in container
- Server-side rendering
- Performance
- Store and view images on Firebase Storage
- Viewing the page on browser HOT 2
- A La Carte (Vuetify)
- Modular routing HOT 1
- Modular translation
- Upgrade to Babel 7 HOT 1
- Remove libraries that are no longer in use
- Docker secrets
- Admin dashboard template
- Pre-rendering pages for SEO HOT 1
- Microservices on the Front-end
- Automated UI testing with Playwright HOT 1
- Upgrade to Webpack 5 HOT 1
- Failed to resolve import +layout.vue file HOT 7
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vue-starter.