Setting up my web root directory

I installed in my LEMP server wordpress under this tutorial and it works fine.

Then when I go to my server IP it opens the wordpress site. But I need to have many WP sites, so what I did, is I created a directory called secure/ and I copied the content of the wordpress into another directory that I created in secure/ so now the wordpress site is in secure/wordpress/ but still when I go my server IP it shows the wordpress site and it shouldnt since I moved all the content to another directory.

How could that happens?

Show comments

Submit an answer

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!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.

What is default_server for? Why in the tuturial doesnt say anything about removing that?

One more thing, I installed again Wordpress in the LEMP server under the same tutorial, so what I have now, is WP located in a folder in the root of my server. I will need to have in my root server the HTML files of my main corporative website, and I’d like to have another folder, with all the rest of my WP sites that I have in another hosting and that I have to migrate to this new one.

How can I start creating new WP installations and how can I start migrating the old WP sites from my other hosting?

Did you reload your nginx configuration? By the way, you should remove default_server from the listen line.

Keep it as: listen IP:80; and comment the ipv6 version for test purpose.

I restarted the nginx server and now the IP doesnt point to the site, thanks.

Then, I moved my wordpress installation folder into a folder that I called secure/ from /home/myserveruser to /home/myserveruser/secure/wordpress and I modified the Nginx config file to like the shown below, but not when I go to myserverIP/secure/wordpress nothing happens, it shows a 404 not found.

server {
        listen 80 default_server;
        listen [::]:80 default_server ipv6only=on;

        root /var/www/secure/wordpress;
        index index.php index.html index.htm;

        # Make site accessible from http://localhost/
        server_name myserverIP;

        location / {
                # First attempt to serve request as file, then
                # as directory, then fall back to displaying a 404.
                try_files $uri $uri/ /index.php?q=$uri&$args;
                # Uncomment to enable naxsi on this location
                # include /etc/nginx/naxsi.rules

        error_page 404 /404.html;
        error_page 500 502 503 504 /50x.html;
        location = /50x.html {
                root /usr/share/nginx/www;

        location ~ \.php$ {
                       try_files $uri =404;
                # With php5-fpm:
                fastcgi_pass unix:/var/run/php5-fpm.sock;
                fastcgi_index index.php;
                include fastcgi_params;