I've been searching for a while to fix this issue but I can't seem to figure it out.
So basically, I've just bought a new domain and I am looking to host it on the same server I am hosting my other one on. However, I seem to be coming across this bug where whenever I try to load my second domain, it loads for a bit then gives me a cloudflare timeout error (522). My first domain always loads correctly though. I did notice something weird though, whenever I remove the first server {}
block, it starts loading what is supposed to be loaded on my second domain, on my first. Anywho, here's my config:
server {
listen 80;
listen [::]:80;
listen 443 ssl;
listen [::]:443 ssl;
ssl on;
ssl_certificate /etc/ssl/certs/server_pnyxdev.pem;
ssl_certificate_key /etc/ssl/private/server_pnyxdev.key;
root /var/www/html/pnyxdev;
index index.php index.html;
server_name pnyx.dev;
location / {
proxy_pass http://localhost:18528/;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
# try_files $uri $uri/ =404;
}
location ~ \.php$ {
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/var/run/php/php7.3-fpm.sock;
}
location ~ /\.ht {
deny all;
}
}
server {
listen 80;
listen [::]:80;
listen 443 ssl;
listen [::]:443 ssl;
ssl on;
ssl_certificate /etc/ssl/certs/server_ethanpro.pem;
ssl_certificate_key /etc/ssl/private/server_ethanpro.key;
root /var/www/html/ethanpro;
index index.php index.html;
server_name ethan.pro;
location / {
proxy_pass http://localhost:1234/;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host "ethan.pro";
proxy_cache_bypass $http_upgrade;
# try_files $uri $uri/ =404;
}
location ~ /\.ht {
deny all;
}
}
Aucun commentaire:
Enregistrer un commentaire