I followed this tutorial to set up my application.
Everything was working fine when I had my IP address as the server name but now that I’ve changed the server name to my domain I’m seeing the following when I visit my domain:
"Welcome to nginx!
If you see this page, the nginx web server is successfully installed and working. Further configuration is required.
For online documentation and support please refer to nginx.org. Commercial support is available at nginx.com.
Thank you for using nginx."
server {
listen 80;
server_name programaticlearning.com;
location = /favicon.ico { access_log off; log_not_found off; }
location /static/ {
root /home/stephen/blog;
}
location /media/ {
root /home/stephen/blog;
}
location / {
include proxy_params;
proxy_pass http://unix:/home/stephen/blog.sock;
}
}
What could be going wrong here? From the tutorial there is a section mentioning trouble shooting nginx and that setting up the server name is the main cause of this issue. However I’ve already set up the server name with my domain name.
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
Hi @stephenlang91,
I can see you’ve configued both /media and /static to go to te same folder. Can I ask if there is a specific reason behind this? Usually, your configuration file should look like this :
server {
listen 80 default_server;
listen [::]:80 default_server;
root /var/www/html;
index index.html index.htm index.nginx-debian.html;
server_name _;
location / {
try_files $uri $uri/ =404;
}
}
Can you try seting up your configuration file like so.
Please remember to change the line
root /var/www/html
with your actual path to your website so it looks like
root /path/to/website
Additionally, where it says
server_name _;
change it to match your domain name, like so
server_name example.com;
Where example.com is your domain.
Regards, KFSys
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.