Why can’t I connect to the wordpress install page with Nginx?


I’m a newbie of WordPress. My environment is Ubuntu 18 + Nginx + PHP 7.

Following the tutorial(https://www.myfreax.com/how-to-install-wordpress-with-nginx-on-ubuntu-18-04/), the wordpress directory was placed on /var/www/html/device1.com.

Then I config the nginx, here is my nginx config:

server {
    listen 80;
    server_name www.device1.com device1.com;

    server_name device1.com;

    root /var/www/html/device1.com;
    index index.php;

    # log files
    access_log /var/log/nginx/device1.com.access.log;
    error_log /var/log/nginx/device1.com.error.log;

    location = /favicon.ico {
        log_not_found off;
        access_log off;

    location = /robots.txt {
        allow all;
        log_not_found off;
        access_log off;

    location / {
        try_files $uri $uri/ /index.php?$args;

    location ~ .php$ {
        include snippets/fastcgi-php.conf;
        fastcgi_pass unix:/run/php/php7.2-fpm.sock;

    location ~* .(js|css|png|jpg|jpeg|gif|ico|svg)$ {
        expires max;
        log_not_found off;


But, when I tried to connect to http://device1.com/wp-admin/install.php
the Nginx responses 404, instead of returning the wordpress install page.

I don’t have any idea of checking the issue.
Thanks for your suggestion.

, , DennisLi 6 months 0 Answers 69 views 0

Leave an answer