Skip to content

Instantly share code, notes, and snippets.

@pioh
Last active October 5, 2016 13:38
Show Gist options
  • Save pioh/e598c69ee8841065e1f36389fc4cf942 to your computer and use it in GitHub Desktop.
Save pioh/e598c69ee8841065e1f36389fc4cf942 to your computer and use it in GitHub Desktop.
server {
listen *:80;
server_name baikal.srg-it.ru;
add_header Access-Control-Allow-Origin *;
if ($ssl_protocol = "") {
return 301 https://$host$request_uri;
}
access_log /var/log/nginx/baikal.srg-it.ru.access.log combined;
error_log /var/log/nginx/baikal.srg-it.ru.error.log;
}
server {
listen *:443 ssl;
server_name baikal.srg-it.ru;
ssl on;
ssl_certificate /etc/nginx/certs/nginx.crt;
ssl_certificate_key /etc/nginx/certs/nginx.key;
ssl_session_cache shared:SSL:10m;
ssl_session_timeout 5m;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-DSS-AES128-GCM-SHA256:kEDH+AESGCM:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA:ECDHE-ECDSA-AES256-SHA:DHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA:DHE-DSS-AES128-SHA256:DHE-RSA-AES256-SHA256:DHE-DSS-AES256-SHA:DHE-RSA-AES256-SHA:AES128-GCM-SHA256:AES256-GCM-SHA384:AES128-SHA:AES256-SHA:AES:CAMELLIA:DES-CBC3-SHA:!aNULL:!eNULL:!EXPORT:!DES:!RC4:!MD5:!PSK:!aECDH:!EDH-DSS-DES-CBC3-SHA:!EDH-RSA-DES-CBC3-SHA:!KRB5-DES-CBC3-SHA;
ssl_prefer_server_ciphers on;
gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript application/javascript;
index index.html;
access_log /var/log/nginx/ssl-baikal.srg-it.ru.access.log combined;
error_log /var/log/nginx/ssl-baikal.srg-it.ru.error.log;
add_header Access-Control-Allow-Origin *;
location ~* ^\/api\/.*$ {
proxy_pass http://baikal.srg-it.ru:8080;
proxy_read_timeout 90;
proxy_connect_timeout 90;
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;
}
location / {
root /usr/share/nginx/html/baikal;
index index.html;
try_files $uri $uri/ /index.html;
}
gzip on;
gzip_buffers 16 8k;
gzip_comp_level 6;
gzip_http_version 1.1;
gzip_proxied any;
gzip_vary on;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment