Title: Vuejs 3 Route behave different with dev and production, No input file specified
Tags: routes;vuejs3;production
Question: Hi i am pretty new to Vuejs3. i have deployed my project as below
physical path : /home/forge/abc.kaung.com.mm/my-game-vue
web address : https://abc.kaung.com.mm
what I am trying to do is when user refresh the page or enter URL directly to browser address bar I redirect to my index page.
in development (local) everything is working fine. when I type http://localhost:8080/hello it will redirect to my index page but in production it show No input file specified message in blank page.
all route are working fine and my project has no issue also. only thing is that in production it won't redirect to my index page.
i research google and it says because I deployed my project to sub folder and not in root. but in vue.config.js I have specified publicpath as
module.exports = {
publicPath: process.env.NODE_ENV === 'production'
? '/my-game-vue/'
: '/'
but when I refresh the page it show blank page(not working anything anymore).
Can someone help me what am I missing please.
thank you so much for your time and help. sorry for my bad english.


Here is another answer: thank you, everyone. i have solved the problem.
I changed the Nginx config file as below
cd /etc/nginx/sites-available
sudo nano abc.kaung.com.mm
change this
location / {
try_files $uri $uri/ /index.php;
to this
location / {
try_files $uri $uri/ /index.html;
sudo nginx -t
sudo systemctl reload nginx
Now the problem is fixed.

{'source': 'StackExchangeDataset', 'subset': 'stackoverflow.com', 'metadata': {'AnswerCount': 1, 'CommentCount': 0, 'ContentLicense': 'CC BY-SA 4.0', 'CreationDate': '2021:00:06/15/21', 'FavoriteCount': None, 'PostTypeId': 1, 'Tags': '<routes><vuejs3><production>', 'Title': 'Vuejs 3 Route behave different with dev and production, No input file specified', 'ViewCount': 57, 'id': 67980275, 'user_AboutMe': '', 'user_AccountId': 1183116.0, 'user_DisplayName': 'kaung htet naing', 'user_Reputation': 55.0, 'user_Views': 42.0, 'user_id': 1157593.0}}