If i remove WordPress and place a simple HTML file it works fine but when i remove it and place WordPress it gives internal server error. And auto redirect of http to https is also not working. I’ve worked with apache2 server in LAMP stack and it works fine with it but its my first time with LEMP stack. Am i doing something wrong??
I searched online about the problem and found a solution that nginx conf file should be modified and my both problems are gone but it did not work.
Here is the aipantomath.com.nginx.conf file that i edited from /home/admin/conf/web/
server {
listen 80;
listen [::]:80;
server_name aipantomath.com www.aipantomath.com;
return 301 https://$host$request_uri;
}
server {
listen 443;
listen [::]:443;
server_name aipantomath.com www.aipantomath.com;
root /home/admin/web/aipantomath.com/public_html;
index index.php index.html index.htm;
access_log /var/log/nginx/domains/aipantomath.com.log combined;
access_log /var/log/nginx/domains/aipantomath.com.bytes bytes;
error_log /var/log/nginx/domains/aipantomath.com.error.log error;
location / {
location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
expires max;
}
location / {
try_files $uri $uri/ /index.php?$args;
}
location ~ [^/]\.php(/|$) {
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
if (!-f $document_root$fastcgi_script_name) {
return 404;
}
fastcgi_pass 127.0.0.1:9001;
fastcgi_index index.php;
include /etc/nginx/fastcgi_params;
}
}
error_page 403 /error/404.html;
error_page 404 /error/404.html;
error_page 500 502 503 504 /error/50x.html;
location /error/ {
alias /home/admin/web/aipantomath.com/document_errors/;
}
location ~* "/\.(htaccess|htpasswd)$" {
deny all;
return 404;
}
location /vstats/ {
alias /home/admin/web/aipantomath.com/stats/;
include /home/admin/conf/web/aipantomath.com.auth*;
}
include /etc/nginx/conf.d/phpmyadmin.inc*;
include /etc/nginx/conf.d/phppgadmin.inc*;
include /etc/nginx/conf.d/webmail.inc*;
include /home/admin/conf/web/nginx.aipantomath.com.conf*;
}
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!
Hello,
In such cases what I usually recommend is:
nginx -t
tail -100 /var/log/nginx/error.log
systemctl status nginx
With all of the above information, you should be able to get to the bottom of the case.
Regards, Bobby
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.