I have set up of wordpress (/) and react build folder(/map) as setup in nginx. the conf file looks like this
upstream index_php_upstream {
server 127.0.0.1:8090;
}
upstream direct_php_upstream {
server 127.0.0.1:8091;
}
upstream react_point {
server 127.0.0.1:3000;
}
server {
listen 80 default_server;
listen [::]:80 default_server ipv6only=on;
server_name _;
root /var/www/html/wordpress/public_html;
index index.html index.php;
# log files
access_log /var/log/nginx/sample.com.access.log;
error_log /var/log/nginx/sample.com.error.log;
location = /favicon.ico {
log_not_found off;
access_log off;
}
location = /robots.txt {
allow all;
log_not_found off;
access_log off;
}
location / {
try_files $uri $uri/ /index.php?$args;
}
location ~ \.php$ {
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/run/php/php7.2-fpm.sock;
}
location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg)$ {
expires max;
log_not_found off;
}
location ^~ /map {
alias /opt/urbanwater/build/;
index index.html index.html;
try_files $uri $uri/ /map/index.html?$args =404;
}
}
the application is working fine when I use It normally. but when I refresh the sub page in map
for e.g. /map/explore-towns
it is taking me to Wordpress page saying 404 not found.
what might be the problem here?