I haven't been able to figure out why I'm getting this error:
nginx: [warn] conflicting server name "stage.mydomain.com" on 0.0.0.0:80, ignored nginx: [warn] conflicting server name "stage.mydomain.com" on 0.0.0.0:443, ignored
My sites-enabled symlink file looks like. I'm not super familiar with this but I'm the only one that has any knowledge on servers. This was copied over from production. I see that port 80 and 443 are duplicated but there are some configuration differences in each block.
server {
listen 80;
server_name stage.mydomain.com;
return 301 https://stage.mydomain.com$request_uri$is_args;
}
server {
listen 80;
server_name stage.mydomain.com;
location '/.path/here' {
default_type "text/plain";
root /home/username/www/app_name/current/public;
}
return 301 https://stage.mydomain.com$request_uri$is_args;
}
server {
listen 443;
ssl on;
ssl_certificate /a/path/to/my/file.pem;
ssl_certificate_key /a/path/to/my/key.pem;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
##ssl_ciphers HIGH:!aNULL:!MD5;
ssl_ciphers "randomstuffhere";
ssl_prefer_server_ciphers on;
client_max_body_size 32000M;
server_name stage.mydomain.com;
return 301 https://stage.mydomain.com$request_uri;
}
server {
listen 443;
ssl on;
ssl_certificate /a/path/to/my/file.pem;
ssl_certificate_key /a/path/to/my/key.pem;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
##ssl_ciphers HIGH:!aNULL:!MD5;
ssl_ciphers "randomstuffhere";
ssl_prefer_server_ciphers on;
client_max_body_size 32000M;
server_name stage.mydomain.com;
root /home/username/www/app_name/current/public; # <--- be sure to point to 'public'!
passenger_enabled on;
rails_env staging;
}