I am trying to deploy my django app on google cloud platform. I am using nginx and gunicorn. I am following this guide.
I have created a file - le_website - under the folder sites-available. This is the code -
server {
listen 80;
server_name 10.xxx.x.x;
location = /favicon.ico {access_log off;log_not_found off;}
location = /static/ {
root /home/jainpriyanshu1991/learnEarn/le-webiste;
}
location = / {
include proxy_params;
proxy_pass http://unix:/home/jainpriyanshu1991/learnEarn/le-webiste/le_website.sock;
}
}
When I try the url myIPaddress/static/ , it works and shows the folders inside it. But it does not work for any subfolder within static. It gives /usr/share/nginx/html/static/img/index.html is not found for img folder inside static. Similarly, when I try the url myIPaddress/ it opens the homepage of website but again, it does not work for any other link and gives error. For about page it gives error /usr/share/nginx/html/about failed (2: No such file or directory).