nginx and apache dont work together

I set up Apache on my VPS after I choosed to use Nginx. I changed the port for Nginx to 8000 but when I go to Nginx page I get just Apache welcome page. I shut down Apache so dont understand how can be there. when i go to i got :

403 Forbidden nginx/1.6.2

thanks. mike

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.

can you help somebody ?

I changed nginx default to: but still the same. at IP and is the same index.html. really dont understand. when go to i get normal apache welcome site.

we have a lot of website on shared hosting and would like to move one by one all to digitalocean. Also I would like to have some localhost on my VPN. And also pushing from my localhost to VPN through capistrano and github. I bit confused if I am right.

server { listen 80;

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


    location / {
            try_files $uri $uri/ /index.html;

    error_page 404 /404.html;

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

Nginx is working on port 80 as this moment, also is set to read files from /var/www; directory, if your apache files where there before you installed the nginx you need to change such files or change the root directive to use the folder where your site is hosted

root /var/www;


root /var/www/;

Also this means nginx is listening on port 80: server { listen 80;

And server_name is the domain name, no the ip so you should change it server_name;


server_name; <- notice the . before the domain, that’s a wildcard so www, and any other subdomain works too.