Opened 10 years ago
Closed 10 years ago
#628 closed task (invalid)
nginx serving wrong certificate for another domain?
Reported by: | Lorenzo Raffio | Owned by: | |
---|---|---|---|
Priority: | minor | Milestone: | |
Component: | nginx-core | Version: | 1.7.x |
Keywords: | ssl certificate sni | Cc: | |
uname -a: | |||
nginx -V: | 1.7.4 |
Description
I have SNI installed and running fine. I have 6 websites hosted on the same VPS, same IP. 5 of them work just fine, every one is serving its correct ssl certificate.
But there's one that even if I'm setting ssl_certificate to the correct crt file related to that domain, is serving the certificate of another domain! (WTF?)
Here's the whole conf file for this domain:
fastcgi_cache_path /var/www/blabla.it/cache levels=1:2 keys_zone=blabla.it:100m inactive=60m; server { ### MAIN ### server_name .blabla.it; index index.php; root /var/www/blabla.it/htdocs; ssl_stapling on; ssl_stapling_verify on; ssl_trusted_certificate /var/www/blabla.it/ssl/ca-certs.pem; ssl_certificate /var/www/blabla.it/ssl/ssl.crt; ssl_certificate_key /var/www/blabla.it/ssl/ssl.key; access_log /var/www/blabla.it/logs/access.log.gz combined gzip; error_log /var/www/blabla.it/logs/error.log; charset utf-8; rewrite ^/sitemap_index\.xml$ /index.php?sitemap=1 last; rewrite ^/([^/]+?)-sitemap([0-9]+)?\.xml$ /index.php?sitemap=$1&sitemap_n=$2 last; location / { try_files $uri $uri/ /index.php?$args; } location ~ \.php$ { fastcgi_cache blabla.it; fastcgi_cache_valid 200 5m; fastcgi_cache_bypass $no_cache; fastcgi_no_cache $no_cache; try_files $uri =404; fastcgi_split_path_info ^(.+\.php)(/.+)$; include fastcgi.conf; fastcgi_pass unix:/var/run/php5-fpm.sock; } ### CONFIGS ### include conf/h5bp.conf; include conf/expires.conf; ### TRIVIAL ### # Deny dot files: location ~ /\. { deny all; } # favicon.ico not found location = /favicon.ico { access_log off; log_not_found off; } # robots.txt not found location = /robots.txt { access_log off; log_not_found off; } ### CACHE ### #Cache everything by default set $no_cache 0; #Don't cache POST requests if ($request_method = POST) { set $no_cache 1; } #Don't cache if the URL contains a query string if ($query_string != "") { set $no_cache 1; } #Don't cache the following URLs if ($request_uri ~* "(/wp-admin/|/xmlrpc.php|/wp-(app|cron|login|register|mail).php|wp-.*.php|/feed/|index.php|wp-comments-popup.php|wp-links-opml.php|wp-locations.php|sitemap(_index)?.xml|[a-z0-9_-]+-sitemap([0-9]+)?.xml)") { set $no_cache 1; } #Don't cache if there is a cookie called PHPSESSID if ($http_cookie ~* "PHPSESSID|comment_author|wordpress_[a-f0-9]+|wp-postpass|wordpress_logged_in") { set $no_cache 1; } }
Change History (3)
comment:1 by , 10 years ago
comment:2 by , 10 years ago
Don't consider the Cloudflare related parameters. It's disabled for the domain.
comment:3 by , 10 years ago
Resolution: | → invalid |
---|---|
Status: | new → closed |
The server{} block in question doesn't have any listen
directives in it, and hence will use listen 80
by default. It's not expected to be used for https requests, as https use port 443.
Don't know if useful but I also add general nginx config.
And one other strange thing is that when for example I got to my wordpress login page over https and enter my login details, I'm redirected to the domain of the wrong certificate. Maybe is Strict Transport Security involved?