server {
        listen 80;
        server_name www.cocowinner.com;
        return 301 https://$host$request_uri;

    }

    server {
        listen 443 ssl;
        server_name www.cocowinner.com;

        ssl_certificate /opt/ssl/www.cocowinner.com.pem;
        ssl_certificate_key /opt/ssl/www.cocowinner.com.key;






    access_log /opt/logs/nginx/www.cocowinner.com_access.log main;
    error_log  /opt/logs/nginx/www.cocowinner.com_error.log;

     location /images/ {
             alias /home/one/images/;
    add_header 'Access-Control-Allow-Origin' '*';
    add_header 'Access-Control-Allow-Methods' 'GET, OPTIONS';
    add_header 'Access-Control-Allow-Headers' 'DNT,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Range';
    add_header 'Access-Control-Expose-Headers' 'Content-Length,Content-Range';

                }

     location /apk/ {
             alias /home/one/apk/;
    add_header 'Access-Control-Allow-Origin' '*';
    add_header 'Access-Control-Allow-Methods' 'GET, OPTIONS';
    add_header 'Access-Control-Allow-Headers' 'DNT,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Range';
    add_header 'Access-Control-Expose-Headers' 'Content-Length,Content-Range';

                }
        location / {
            proxy_pass http://127.0.0.1:8093;
            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 X-Forwarded-Proto $scheme;
        }
  location /indwin/app {
                 alias /home/one/web;
           try_files $uri $uri/ /index.html;
           index index.html index.htm;
        }

    location ~ /ws {
        # WebSocket proxy
        proxy_pass http://127.0.0.1:8888;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection $connection_upgrade;
        proxy_read_timeout 300s;
    }
}
