Welcome! Log In Create A New Profile

Advanced

Bouncing to Default Server Block

September 28, 2018 08:44AM
I have a test server up with 3 domains.

First domain redirects port 80 to ssl 443.
Second domain is just port 80.
Third domain is just port 80.

Second domain isn’t showing up, pointing to first domain. Third domain is working. Why would this happen?

nginx.conf:

# user nginx;
worker_processes auto;

error_log /var/log/nginx/error.log;
pid /run/nginx.pid;
events { worker_connections 1024; }

http {
include /etc/nginx/mime.types;
keepalive_timeout 65s;
gzip on;
index index.html;

passenger_app_env development;
passenger_friendly_error_pages on;
include /etc/nginx/conf.d/*.conf;

server {
listen 80;
server_name domain1.ca www.domain1.ca;
return 301 https://$server_name$request_uri;
}

server {
listen 443 default_server;
server_name domain1.ca www.domain1.ca;
access_log /var/log/nginx/access_domain1.log;
error_log /var/log/nginx/error_domain1.log warn;
error_page 404 /404.html;
client_max_body_size 3M;
root /var/www/domain1/public;
passenger_enabled on;
passenger_base_uri /;

location / {
autoindex off;
}
location = /img/favicon.ico { access_log off;}

ssl on;
ssl_certificate /etc/nginx/ssl/domain1_ca.crt;
ssl_certificate_key /etc/nginx/ssl/domain1.key;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_ciphers ALL:!aNULL:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP;
}

server {
listen 80;
server_name domain2 www.domain2;
access_log /var/log/nginx/access_vp.log;
error_log /var/log/nginx/error_vp.log debug;
error_page 404 /404.html;
root /var/www/domain2/public;
passenger_enabled on;
passenger_base_uri /;

location / {
autoindex off;
# index /;
}
location = /favicon.ico { access_log off; log_not_found off; }
location = /robots.txt { access_log off; log_not_found off; }
sendfile off;
}

server {
listen 80;
server_name domain3.com www.domain3.com;
access_log /var/log/nginx/access_domain3.log;
error_log /var/log/nginx/error_domain3.log error;
error_page 404 /404.html;
root /var/www/domain3/public;
passenger_enabled on;
passenger_base_uri /;

location / {
autoindex off;
index /;
}

location = /img/favicon.ico { access_log off; log_not_found off; }
location = /robots.txt { access_log off; log_not_found off; }
sendfile off;
}
}








Cheers, Bee




_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

Bouncing to Default Server Block

daBee September 28, 2018 08:44AM

RE: Bouncing to Default Server Block

Reinis Rozitis September 28, 2018 11:22AM

Re: Bouncing to Default Server Block

daBee September 28, 2018 11:50AM

Re: Bouncing to Default Server Block

daBee September 28, 2018 12:58PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 176
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 500 on July 15, 2024
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready