I initialized an Ubuntu server with Wordpress on Vult. I had to uninstall Nginx and remove Certbot due to some issues I encountered. I used
$ sudo apt purge nginx
$ sudo apt purge certbot
After removing all of these, I reinstalled and set secured my domains. Now when I navigate to my URL, I see the Nginx welcome page. I do not have any files in my /etc/nginx/conf.d folder except for default.conf
server {
server_name my.domain;
#access_log /var/log/nginx/host.access.log main;
location / {
root /usr/share/nginx/html;
index index.html index.htm;
}
#error_page 404 /404.html;
# redirect server error pages to the static page /50x.html
#
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
}
# proxy the PHP scripts to Apache listening on 127.0.0.1:80
#
#location ~ \.php$ {
# proxy_pass http://127.0.0.1;
#}
# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
#
#location ~ \.php$ {
# root html;
# fastcgi_pass 127.0.0.1:9000;
# fastcgi_index index.php;
# fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name;
# include fastcgi_params;
#}
# deny access to .htaccess files, if Apache's document root
# concurs with nginx's one
#
#location ~ /\.ht {
# deny all;
#}
listen 443 ssl; # managed by Certbot
ssl_certificate /etc/letsencrypt/live/choice.radio/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/choice.radio/privkey.pem; # managed by Certbot
include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot
}
server {
if ($host = my.domain) {
return 301 https://$host$request_uri;
} # managed by Certbot
if ($host = my.domain) {
return 301 https://$host$request_uri;
} # managed by Certbot
listen 80;
server_name my.domain;
return 404; # managed by Certbot
}
My wordpress is installed on /var/www/html
I have tried to change the location to:
location / {
root /var/www/html;
index index.php;
}
But when I visit my domain it downloads the php file instead of serving the website.
I have tried various other file options but Nginx throws an error.
Please help.