Сообщество IT-специалистов
Ответы на любые вопросы об IT
Профессиональное развитие в IT
Удаленная работа для IT-специалистов
location /chats/ { #add_header Content-Type application/json; proxy_pass http://0.0.0.0:4444/; proxy_pass_request_headers on; }
upstream php { server unix:/run/php/php7.4-fpm.sock; } server { server_name dev.ru *.dev.ru; access_log /var/log/nginx/dev-access.log; error_log /var/log/nginx/dev-error.log; client_max_body_size 5000m; client_header_buffer_size 5m; large_client_header_buffers 16 5m; error_page 502 /502.html; # add_header 'Access-Control-Allow-Origin' '*'; location /socket.io/ { proxy_pass http://127.0.0.1:3001; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade"; proxy_send_timeout 86400; proxy_read_timeout 86400; proxy_set_header Host $host; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Real-IP $remote_addr; # New proxy_connect_timeout 15s; proxy_buffers 512 256M; proxy_buffer_size 256M; } location /video/ { rewrite /video/(.*) /$1 break; proxy_pass http://127.0.0.1:3001; proxy_pass_header Server; proxy_set_header Host $host; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Real-IP $remote_addr; client_max_body_size 5000m; #add_header Access-Control-Allow-Origin *; } # calls-service location /c-api/ { rewrite /c-api/(.*) /$1 break; proxy_pass http://127.0.0.1:3005; proxy_pass_header Server; proxy_set_header Host $host; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Real-IP $remote_addr; client_max_body_size 5000m; } location /pay/ { rewrite /pay/(.*) /$1 break; proxy_pass http://127.0.0.1:3000; proxy_pass_header Server; proxy_set_header Host $host; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Real-IP $remote_addr; client_max_body_size 5000m; } location /pay-moneta/ { rewrite /pay-moneta/(.*) /$1 break; proxy_pass http://127.0.0.1:4000/; proxy_pass_header Server; proxy_set_header Host $host; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Real-IP $remote_addr; client_max_body_size 5000m; } # viddev static location /chat/(*\.(js|css|jpg)) { try_files $uri =404; rewrite /chat/(.*) /chat/$1 break; } location /chats/ { #add_header Content-Type application/json; proxy_pass http://0.0.0.0:4444/; #proxy_pass_request_headers on; } location / { try_files $uri $uri/ @rewrite; index index.php index.html; add_header Access-Control-Allow-Origin *; } location @rewrite { rewrite ^/(.*)$ /index.php?q=$1; } location @proxy { proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade"; proxy_set_header Host $host; proxy_pass https://.ru; proxy_redirect off; } location ~ \.php$ { try_files $uri =404; fastcgi_split_path_info ^(.+\.php)(.*)$; fastcgi_pass unix:/var/run/php/php7.4-fpm.sock; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; include fastcgi_params; fastcgi_ignore_client_abort on; fastcgi_param SERVER_NAME $http_host; client_max_body_size 5000m; fastcgi_buffers 16 16k; fastcgi_buffer_size 32k; } location = /500.html { root /usr/share/nginx/html/; } set $need_redirect "0"; if ($host ~* ^www\.(.*)$) { set $need_redirect "1"; } if ($request_uri ~* "well-known") { set $need_redirect "0"; } if ( $need_redirect ~ "1") { return 301 https://$server_name$request_uri; } } #server { # listen *:80; # return 301 https://$server_name$request_uri; # enforce https # server_name .ru; #}
add_header
proxy_set_header Content-type application/json;