server { listen 80; server_name lmstqo.spottorg.ru; return 301 https://$server_name$request_uri; } server { listen 443 ssl; server_name lmstqo.spottorg.ru; ssl_certificate /etc/nginx/ssl/spottorg.crt; ssl_certificate_key /etc/nginx/ssl/spottorg.key; root /application/public; client_max_body_size 30m; location / { proxy_pass http://lms:3000; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection 'upgrade'; proxy_set_header Host $host; proxy_cache_bypass $http_upgrade; chunked_transfer_encoding off; proxy_buffering off; proxy_cache off; } location /socket.io/auctionreload { access_log /var/log/nginx/ws_access.log json; error_log /var/log/nginx/ws_error.log; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection $connection_upgrade; proxy_set_header Host $host; proxy_pass http://php:8080/; } location @rewriteapp { rewrite ^(.*)$ /index.php/$1 last; } # location /storybook { # alias /application/nuxt/storybook-static; # } location /logout { try_files $uri @rewriteapp; } location /api { rewrite ^(.*)$ /index.php/$1 last; } location /clockwork { rewrite ^(.*)$ /index.php/$1 last; } location /__clockwork { rewrite ^(.*)$ /index.php/$1 last; } location /pdf { rewrite ^(.*)$ /index.php/$1 last; } location /1c { rewrite ^(.*)$ /index.php/$1 last; } location /socket { try_files $uri @rewriteapp; } location /admin { try_files $uri @rewriteapp; } location ~* \/admin\/.*(js|jpg|png|css|woff|woff2)$ { proxy_pass http://static; } location /media { try_files $uri @rewriteapp; } location /img { proxy_pass http://static; # alias /application/public/img; # try_files $uri /index.php$request_uri; # expires 6M; } location /css { proxy_pass http://static; } location /robots.txt { proxy_pass http://static; } location /connection/websocket { proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "Upgrade"; proxy_pass http://centrifugo; } location ~ ^/index\.php(/|$) { if ($request_method = 'OPTIONS') { add_header 'Access-Control-Allow-Origin' $http_origin; add_header 'Access-Control-Allow-Credentials' 'true'; add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS, DELETE'; add_header 'Access-Control-Allow-Headers' 'DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,X-Expeditor-Domain,Authorization'; add_header 'Access-Control-Max-Age' 1728000; add_header 'Content-Type' 'text/plain charset=UTF-8'; add_header 'Content-Length' 0; return 204; } #add_header 'Access-Control-Allow-Origin' $http_origin; add_header 'Access-Control-Allow-Origin' *; add_header 'Access-Control-Allow-Credentials' 'true'; add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS, DELETE'; add_header 'Access-Control-Allow-Headers' 'DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,X-Expeditor-Domain,Authorization'; fastcgi_pass backend:9001; fastcgi_split_path_info ^(.+\.php)(/.*)$; include fastcgi_params; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; } }