Main page not loading, but other pages do.
-
I recently set up a new WordPress site on nginx, I followed a tutorial I found online and It installed normally without any problems, the admin page works fine, posts load fine, but the main page doesn’t. I just get “Unable to connect”

By main page I mean the root directory, the page you land on when you type the URL http://www.example.com.
However, If I manually type the page name, for example http://www.example.com/documentation/ it loads fine and I can navigate all the menu items and pages with no problem.

The site is not set up with HTTPS and I’m using a different port (9004) that is then redirected through NAT.
At the same time, I have another nginx virtual host set up that works just fine with absolutely no problems.
Here is my config file:
`
configuration file /etc/nginx/conf.d/[redacted].com.conf:server {
listen 80;
listen [::]:80;
server_name www.[redacted].com [redacted].com;
root /usr/share/nginx/[redacted].com/;
index index.html index.php;error_log /var/log/nginx/wordpress.error;
access_log /var/log/nginx/wordpress.access;location / {
try_files $uri $uri/ /index.php;
}location ~ ^/wp-json/ {
rewrite ^/wp-json/(.*?)$ /?rest_route=/$1 last;
}location ~* /wp-sitemap.*.xml {
try_files $uri $uri/ /index.php$is_args$args;
}error_page 404 /404.html;
error_page 500 502 503 504 /50x.html;client_max_body_size 20M;
location = /50x.html {
root /usr/share/nginx/html;
}location ~ .php$ {
fastcgi_pass unix:/run/php/php8.1-fpm.sock;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
include snippets/fastcgi-php.conf;
fastcgi_buffers 1024 4k;
fastcgi_buffer_size 128k;
}#enable gzip compression
gzip on;
gzip_vary on;
gzip_min_length 1000;
gzip_comp_level 5;
gzip_types application/json text/css application/x-javascript application/javascript image/svg+xml;
gzip_proxied any;# A long browser cache lifetime can speed up repeat visits to your page
location ~* .(jpg|jpeg|gif|png|webp|svg|woff|woff2|ttf|css|js|ico|xml)$ {
access_log off;
log_not_found off;
expires 360d;
}# disable access to hidden files
location ~ /.ht {
access_log off;
log_not_found off;
deny all;
}
}` -
-
Thanks for confirming!
Just to clarify things, there are three different versions of “WordPress” that you should be aware of:
- The free, open-source WordPress software which powers your website.
- WordPress.org which is the open-source project that works on the WordPress software and where you can get the software for free to use on your own hosting provider.
- WordPress.com which is a managed hosting provider of the WordPress software and with whom you’re contacting now.
If you ever face any difficulty in the future, don’t hesitate to ask for help from the supportive WordPress community. You can find guidance and solutions to your issues in the WordPress forum at:
https://wordpress.org/support/forum/how-to-and-troubleshooting
I hope this information is useful to you!
- The topic ‘Main page not loading, but other pages do.’ is closed to new replies.