Maxim Yefremov
Maxim Yefremov

Reputation: 14165

nginx ignores my site configuration

I created site config file in dir /etc/nginx/sites-enabled

server {
    listen 80;
    server_name domain.com;
    gzip_types application/x-javascript text/css;
    access_log /var/log/nginx/nodeApp.info9000p.access.log;
    location / {
        proxy_pass    http://127.0.0.1:9000/;
    }
    location ~ ^/(min/|images/|bootstrap/|ckeditor/|img/|javascripts/|apple-touch-icon-ipad.png|apple-touch-icon-ipad3.png|apple-touch-icon-iphone.png|apple-touch-icon-iphone4.png|generated/|js/|css/|stylesheets/|robots.txt|humans.txt|favicon.ico) {
          root /root/Dropbox/nodeApps/nodeApp/9000/appdirectory-build; 
          access_log off;
          expires max;
        }
}

and restarted nginx:

sudo /etc/init.d/nginx restart

But nginx ignore my site config file and shows default page, when I request domain.com :

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.

Upvotes: 2

Views: 4518

Answers (2)

Tesfalem Gdey
Tesfalem Gdey

Reputation: 11

Where are your Wordpress-files located?

The default nginx htdocs-root is /usr/share/nginx/html

If you've installed the files at, say, /usr/share/nginx/html/wordpress, then you must change the root-setting in the file /etc/nginx/conf.d/default.conf to that directory, like this

server {
root /usr/share/nginx/html/wordpress;
}

Plese read the https://www.digitalocean.com/community/tutorials/how-to-install-linux-nginx-mysql-php-lemp-stack-on-centos-7 article on how to set up nginx to work with the PHP-engine over socket (CentOS) if you have not already done so.

Upvotes: 1

Maxim Yefremov
Maxim Yefremov

Reputation: 14165

Don't know how, but my configuration started to work well. Maybe because I restarted nginx instead of reload it.

Upvotes: 0

Related Questions