user root;

worker_processes  1;

error_log  /var/log/nginx/error.log warn;
pid        /var/run/nginx.pid;

events {    
	worker_connections  1024;
}

http {
        include mime.types;
	keepalive_timeout  65;
	sendfile        on; 	
	
	server {
		#security
		server_tokens off;
        	add_header X-XSS-Protection "1; mode=block";
			add_header Access-Control-Allow-Origin cdn.dennisgunia.de;
        	add_header X-Robots-Tag none;
        	add_header X-Download-Options noopen;
        	add_header X-Permitted-Cross-Domain-Policies none;
        	add_header Referrer-Policy no-referrer;
		add_header Cache-Control no-cache;
		default_type  text/html;
        	gzip on;
        	gzip_static on;
        	gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript;


		location / {
        	        root /usr/share/nginx/html;
        	        try_files $uri $uri/ /index.html;
			expires -1;
	        }

	        location /unogame {
			resolver 127.0.0.11 ipv6=off;
	                #proxy_set_header X-Real-IP $remote_addr;
					proxy_read_timeout 300s;
    				proxy_connect_timeout 75s;
	                proxy_pass http://backend:3000;

	        }
		location /stream {
			resolver 127.0.0.11 ipv6=off;
	                proxy_pass http://backend:3000;
			proxy_http_version 1.1;
			proxy_set_header Upgrade $http_upgrade;
			proxy_set_header Connection "Upgrade";
			proxy_set_header Host $host;
	        }
	
		listen 80;

	}
}

