server { listen 80; server_name doc.ruby-lang.org; location /.well-known/acme-challenge { default_type “text/plain”; root /var/www/html; } location / { return 301 https://docs.ruby-lang.org$request_uri; } }
server { listen 80; server_name docs.ruby-lang.org; location /.well-known/acme-challenge { default_type “text/plain”; root /var/www/html; } location / { return 301 https://docs.ruby-lang.org$request_uri; } }
server { listen 80; server_name docs-origin.ruby-lang.org; location / { root /var/www/html; } }
server { listen 443 ssl http2; listen [::]:443 ssl http2;
server_name docs.ruby-lang.org docs-origin.ruby-lang.org;
ssl_certificate /etc/letsencrypt/live/docs-origin.ruby-lang.org/fullchain.pem; ssl_certificate_key /etc/letsencrypt/live/docs-origin.ruby-lang.org/privkey.pem; ssl_session_timeout 1d; ssl_session_cache shared:MozSSL:10m; # about 40000 sessions ssl_session_tickets off;
ssl_dhparam /etc/nginx/dhparam.pem;
ssl_protocols TLSv1.2; ssl_ciphers ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384; ssl_prefer_server_ciphers off;
ssl_stapling on; ssl_stapling_verify on;
ssl_trusted_certificate /etc/letsencrypt/live/docs-origin.ruby-lang.org/chain.pem;
resolver 8.8.8.8;
proxy_set_header X-Forwarded-Host $host; proxy_set_header X-Forwarded-Proto https; proxy_set_header X-Forwarded-Port 443;
location / { root /var/www/docs.ruby-lang.org/current/public; index index.html;
add_header Cache-Control “public, max-age=43200, s-maxage=172800, stale-while-revalidate=86400, stale-if-error=604800”; add_header Surrogate-Key “index”;
location ~ ^/en/trunk(.*) { return 301 https://docs.ruby-lang.org/en/master$1; }
location ~ ^/en/([^/]+)/doc/(.*) { return 301 https://docs.ruby-lang.org/en/$1/$2; }
location ~ ^/(en|ja)/2.8.0(.*) { return 301 https://docs.ruby-lang.org/$1/3.0$2; }
location ~ ^/(en|ja)/3.0.0(.*) { return 301 https://docs.ruby-lang.org/$1/3.0$2; }
location ~ ^/ja/3.1.0(.*) { return 301 https://docs.ruby-lang.org/ja/3.1$1; }
location ~ ^/(en|ja)/(.+?)/ { add_header Cache-Control “public, max-age=43200, s-maxage=172800, stale-while-revalidate=86400, stale-if-error=604800”; add_header Surrogate-Key “docs $1 $2 $1/$2”; } }
location /ja/search { proxy_pass http://localhost:9292; }
location ~ /ja/search/(css|javascripts) { rewrite ^/ja/search/(.+)$ /$1 break; root /var/rubydoc/rurema-search/current/public; add_header Cache-Control “public, max-age=43200, s-maxage=172800, stale-while-revalidate=86400, stale-if-error=604800”; add_header Surrogate-Key “rurema-search-assets”; }
error_page 500 502 503 504 /50x.html; location = /50x.html { root /usr/share/nginx/html; } }
server { listen 9292; server_name localhost; root /var/rubydoc/rurema-search/current/public; passenger_enabled on;
add_header Cache-Control “public, max-age=3600, s-maxage=172800, stale-while-revalidate=86400, stale-if-error=60”; add_header Surrogate-Key “rurema-search-app”; }
server { listen 443 ssl http2; listen [::]:443 ssl http2;
server_name doc.ruby-lang.org;
ssl_certificate /etc/letsencrypt/live/doc.ruby-lang.org/fullchain.pem; ssl_certificate_key /etc/letsencrypt/live/doc.ruby-lang.org/privkey.pem; ssl_session_timeout 1d; ssl_session_cache shared:MozSSL:10m; # about 40000 sessions ssl_session_tickets off;
ssl_dhparam /etc/nginx/dhparam.pem;
ssl_protocols TLSv1.2; ssl_ciphers ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384; ssl_prefer_server_ciphers off;
ssl_stapling on; ssl_stapling_verify on;
ssl_trusted_certificate /etc/letsencrypt/live/doc.ruby-lang.org/chain.pem;
resolver 8.8.8.8;
return 301 https://docs.ruby-lang.org$request_uri; }