server { server_name iptv.local; listen 80; index index.html index.php; # access_log /var/log/nginx/access.log; error_log /var/log/nginx/error.log warn; add_header Access-Control-Allow-Origin '*'; add_header Access-Control-Allow-Methods 'GET, POST, OPTIONS'; add_header Access-Control-Allow-Headers "*"; add_header Access-Control-Allow-Credentials "true"; gzip on; gzip_vary on; gzip_proxied any; gzip_comp_level 6; gzip_buffers 16 8k; gzip_http_version 1.1; gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript; location = /docs { return 301 /docs/; } location ^~ /docs/ { alias /usr/share/nginx/html/doc-files/; index index.html; # access_log /var/log/nginx/docs_access.log; error_log /var/log/nginx/docs_error.log warn; location ~* \.(?:js|css|png|jpg|jpeg|gif|ico|svg)$ { expires 1y; add_header Cache-Control "public"; } } location / { root /var/www/public; try_files $uri $uri/ /index.php$is_args$args; } location ~ \.php$ { root /var/www/public; try_files $uri /index.php =404; fastcgi_pass web:9000; fastcgi_split_path_info ^(.+\.php)(/.+)$; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_param PATH_INFO $fastcgi_path_info; fastcgi_hide_header X-Powered-By; fastcgi_read_timeout 300; proxy_read_timeout 300; include fastcgi_params; location ~* \.(jpg|jpeg|gif|css|png|ttf|woff|svg|js|ico)$ { access_log off; expires max; log_not_found off; } } location ~* \.(jpg|jpeg|gif|css|png|ttf|woff|svg|js|ico)$ { root /var/www/public; access_log off; expires max; log_not_found off; } }