Hi! I have read a lot about this, but I can’t figure it out why is not working for me. The idea is the following: I want to host several websites on a single droplet. The scheme is like this:
wargostudio.com -> stuck oncativosa.wargostudio.com -> working fine jalisco.wargostudio.com -> working fine
example2.com sub1.example2.com … etc
when I go to wargostudio.com, I get a blank page. In the error log, the server is trying to access /usr/share/nginx/html/ but** I have specified another path.** Whats going on?
Thanks very much, and sorry for the length of the question.
server {
listen 80 default_server;
listen [::]:80 default_server;
root /var/www/wargostudio;
index index.php index.html index.htm index.nginx-debian.html;
# include snippets/wp-supercache.conf;
server_name wargostudio.com www.wargostudio.com;
location / {
try_files $uri $uri/ /index.php?$args;
}
location ~ \.php$ {
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/run/php/php7.0-fpm.sock;
}
location ~ /\.ht {
deny all;
}
location ~ /.well-known {
allow all;
}
}
server {
# SSL configuration
listen 443 ssl http2 default_server;
listen [::]:443 ssl http2 default_server;
include snippets/ssl-wargostudio.com.conf;
include snippets/ssl-params.conf;
}
server {
listen 80;
listen [::]:80;
root /var/www/oncativosa;
index index.php index.html index.htm index.nginx-debian.html;
server_name oncativosa.wargostudio.com;
location / {
try_files $uri $uri/ /index.php?$args;
}
location ~ \.php$ {
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/run/php/php7.0-fpm.sock;
}
location ~ /\.ht {
deny all;
}
}
server {
listen 80;
listen [::]:80;
root /var/www/jaliscopaletas;
index index.php index.html index.htm index.nginx-debian.html;
include snippets/wp-supercache.conf;
server_name jalisco.wargostudio.com;
# location / {
# try_files $uri $uri/ /index.php?$args;
# }
# Caching of media: images, icons, video, audio, HTC
location ~* \.(?:jpg|jpeg|gif|png|ico|cur|gz|svg|svgz|mp4|ogg|ogv|webm)$ {
expires 2M;
add_header Cache-Control "public";
}
location ~ \.php$ {
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/run/php/php7.0-fpm.sock;
}
# CSS and Javascript
location ~* \.(?:css|js)$ {
expires 1d;
add_header Cache-Control "public";
}
location ~ /\.ht {
deny all;
}
}
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!
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.
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.
Thanks so much to everyone!!
@francarranza
I’ve actually never seen that error to be honest, though there is one more thing we can try and it doesn’t require too many changes.
Instead of using sockets, we can use TCP.
In each of the
./pool.d
files we modified, find thelisten =
directive. We’ll set PHP-FPM to listen on a specific port instead of using a socket. You’ll increment the port for each site, starting with port 9000./etc/php/7.0/fpm/pool.d/wargostudio.conf
/etc/php/7.0/fpm/pool.d/oncativosa.conf
/etc/php/7.0/fpm/pool.d/jaliscopaletas.conf
No other changes should need to be made as long as you’ve made the previous changes, so let’s go ahead and restart PHP-FPM:
Now we need to modify each NGINX server block to match the new TCP connections.
wargostudio
oncativosa
jaliscopaletas
You’d now restart NGINX:
Now, I can’t tell what’s in
snippets/fastcgi-php.conf
, so if you can post that to a code block using the </> icon, we can see if there’s anything there that may be causing some issues too.Hi, thanks for the answer. I’m having now this issue: Connection refused (111), your cache admin is root. It seems to have a problem with the permissions for the new users.