'Nginx 403 forbidden even with index.html setup
I am kinda new to Nginx and Ubuntu but have been having the problem for a few days and can't really find the reason. I keep getting 403 forbidden when I go to the URL I have been searching around but everyone is saying to check if the index.html exists and I can see that it exists. When I built on localhost and then served with everything worked fine so it shouldn't be a problem with the index.html file. I have been following this guide: https://github.com/Sanjeev-Thiyagarajan/PERN-STACK-DEPLOYMENT
npm install -g serve
serve -s build
ubuntu@ip-hidden:~/apps/bachelor-app/client$ ls
README.md build netlify.toml node_modules package-lock.json package.json public src
ubuntu@ip-hidden:~/apps/bachelor-app/client$ cd build
ubuntu@ip-hidden:~/apps/bachelor-app/client/build$ ls
asset-manifest.json icon.ico index.html logo192.png logo512.png manifest.json robots.txt static
ubuntu@ip-hidden:~/apps/bachelor-app/client/build$ cd /etc/nginx/sites-available
ubuntu@ip-hidden:/etc/nginx/sites-available$ cat dataviz
##
# Default server configuration
server {
listen 80;
listen [::]:80;
root /home/ubuntu/apps/bachelor-app/client/build;
# Add index.php to the liphpinfo.php
server_name [Hidden];
index index.html index.htm index.nginx-debian.html;
}
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
