server {
    listen 80;
    server_name  s.ops.ci;
    return 301 https://s.ops.ci$request_uri;
}

server {
    listen 443 ssl;
    server_name  s.ops.ci;
    index  index.php index.html index.htm;
    gzip on;    

    ssl_certificate /usr/local/nginx/conf/ssl/ops.ci.cer;
    ssl_certificate_key /usr/local/nginx/conf/ssl/ops.ci.key;
    ssl_trusted_certificate /usr/local/nginx/conf/ssl/ops.ci.cer;

    ssl_stapling on;
    ssl_stapling_verify on;
    ssl_protocols TLSv1.1 TLSv1.2 TLSv1.3;
    ssl_prefer_server_ciphers on;
    ssl_ciphers ECDHE-RSA-AES256-GCM-SHA384:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-SHA384:ECDHE-RSA-AES128-SHA256:ECDHE-RSA-AES256-SHA:ECDHE-RSA-AES128-SHA:ECDHE-RSA-DES-CBC3-SHA:AES256-GCM-SHA384:AES128-GCM-SHA256:AES256-SHA256:AES128-SHA256:AES256-SHA:AES128-SHA:DES-CBC3-SHA:!aNULL:!eNULL:!EXPORT:!DES:!MD5:!PSK:!RC4;
    ssl_ecdh_curve secp384r1;
    ssl_session_timeout  10m;
    ssl_session_cache builtin:1000 shared:SSL:10m;
    ssl_session_tickets off;
    resolver 8.8.8.8 8.8.4.4 valid=60s ipv6=off;
    resolver_timeout 5s;
    add_header Strict-Transport-Security "max-age=63072000" always;

    location / {
        proxy_redirect off;
        proxy_pass http://127.0.0.1:8080;

        add_header 'Access-Control-Allow-Origin' '*';
        
        proxy_set_header  Host                $http_host;
        proxy_set_header  X-Real-IP           $remote_addr;
        proxy_set_header  X-Forwarded-Ssl     on;
        proxy_set_header  X-Forwarded-For     $proxy_add_x_forwarded_for;
        proxy_set_header  X-Forwarded-Proto   $scheme;
        proxy_set_header  X-Frame-Options     SAMEORIGIN;

        client_max_body_size        100m;
        client_body_buffer_size     128k;
    }

    access_log /home/wwwlogs/s.ops.ci.access.log  main;
    error_log  /home/wwwlogs/s.ops.ci.error.log  warn;
}
