By host662664
Hello, I have a 512 MB basic package droplet. I am running Ubuntu 14.04 and LEMP stack. I am trying to host multiple wordpress site in a single droplet. I have uploaded my wordpress files to " /var/www/domain.com/html" and configured the nginx block following this tutorial: https://www.digitalocean.com/community/articles/how-to-set-up-nginx-server-blocks-virtual-hosts-on-ubuntu-14-04-lts
My /etc/nginx/sites-available/domain.com block looks like the following:
server { listen 80 default_server; listen [::]:80 default_server ipv6only=on;
root /var/www/domain.com/html;
index index.php index.html index.htm;
server_name 128.199.247.111;
location / {
try_files $uri $uri/ =404;
}
}
But when I try to access the site: http://128.199.247.111 , it gets “could not connect to 128.199.247.111” error.
Any Suggestions.
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!
WordPress requires a PHP pass through with nginx. You should look into configuring PHP5-FPM and then FastCGI with your vhost.
For all the details on setting up Wordpress on Nginx, check out: <br> <br>https://www.digitalocean.com/community/articles/how-to-install-wordpress-with-nginx-on-ubuntu-14-04 <br> <br>The short version is like Rhys mentioned, you need to set up a PHP pass through. So your server block should look like: <br> <br><pre> <br>server { <br> listen 80 default_server; <br> listen [::]:80 default_server ipv6only=on; <br> <br> root /var/www/html; <br> index index.php index.php index.html index.htm; <br> <br> server_name your_domain.com; <br> <br> location / { <br> # try_files $uri $uri/ =404; <br> try_files $uri $uri/ /index.php?q=$uri&$args; <br> } <br> <br> error_page 404 /404.html; <br> <br> error_page 500 502 503 504 /50x.html; <br> location = /50x.html { <br> root /usr/share/nginx/html; <br> } <br> <br> location ~ .php$ { <br> try_files $uri =404; <br> fastcgi_split_path_info ^(.+.php)(/.+)$; <br> fastcgi_pass unix:/var/run/php5-fpm.sock; <br> fastcgi_index index.php; <br> include fastcgi_params; <br> } <br>} <br></pre>
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.