Bonjour,
J’ai un Raspberry PI (qui a dit : comme tout le monde ??) avec donc nginx 1.2.1 sous Raspbian.
Je me suis fait un site DokuWiki en HTTPS, ce qui est relativement simple (j’avais utilisé IP_PUBLIQUE pour y accéder de l’extérieur jusqu’à présent).
J’ai un second site web à héberger sur ce même serveur, l’idée étant que si je tape sur le NET https://site1.no-ip ou https://site2.no-ip, cela me renvoie vers l’un ou l’autre site.
Mes fichiers de site dans /etc/nginx/sites-available/ sont similaires, mis à part le server_name qui correspond bien évidemment à la redirection NO-IP effectuée. Pour mes deux sites, la configuration est la suivante :
[code]server {
listen 443;
server_name site1.no-ip.info;
server_name_in_redirect off;
ssl_certificate /etc/nginx/certs/moncertif.crt;
ssl_certificate_key /etc/nginx/certs/macle.key;
# Path to the root of your installation
root /var/www/site1[/code]
Puis voici mon nginx.conf :
user www-data;
worker_processes 1;
pid /var/run/nginx.pid;
events {
# 1024 is a decent starting point
# You can increase it further, but you should check "ulimit -n" before
# adjusting higher
worker_connections 1024;
}
http {
sendfile on;
tcp_nodelay on;
# This might be better set to on for some, off for some
# for me however, I saw no difference between having it enabled or disabled
tcp_nopush on;
# How long to wait for new request from the same connection
keepalive_timeout 180;
server_tokens off;
include /etc/nginx/mime.types;
default_type application/octet-stream;
# Logging
error_log /var/log/nginx/error.log;
# Gzip Settings
gzip on;
gzip_disable "msie6";
gzip_disable "Wget";
# Make sure any third-party proxies cache things properly
gzip_vary on;
# Compress regardless of caching headers
gzip_proxied any;
# Compress as much as possible
gzip_comp_level 6;
# File types to Gzip compress, it works best for plain text files
gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript;
proxy_cache_path /var/cache/nginx levels=2:2:2 keys_zone=STATIC:100m inactive=24h max_size=100m;
# Include Folders
map_hash_bucket_size 64;
include /etc/nginx/conf.d/*.conf;
include /etc/nginx/sites-enabled/*;
}
Enfin, dans /etc/nginx/conf.d/proxy.conf :
#proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Accept "";
proxy_set_header Connection "";
proxy_cache STATIC;
# Cache 200 (OK), as well as 301 and 302 (redirect) responses for 4h
proxy_cache_valid 200 301 302 4h;
# Cache 404 (Not found) responses for only 10m, just in case of human errors
proxy_cache_valid 404 10m;
# Allow using stale data (cached data that has expired) in the following cases:
# - an error has occurred while connecting to the server, sending a request to it, or reading its response
# - timeout occurred during the connection with the server, transfer the request or while reading response from the server
# - server returned a empty or incorrect answer
# - server returned an error status (500, 502-504)
proxy_cache_use_stale error timeout invalid_header updating http_500 http_502 http_503 http_504;
Mes sites me renvoient tous deux dans Firefox : “Echec de la connexion sécurisé. ssl_error_rx_record_too_long”
J’ai pensé que comme j’utilisais le même certificat pour les deux configurations de sites, cela pouvait faire conflit… J’ai cru voir du chainage de certificat sur Google, mais j’ai pas vraiment compris… Je précise que mon certificat fonctionne lorsqu’un seul site est à héberger (sans Reverse Proxy).
Une idée ?
Merci