php - Nginx $http_x_requested_with is empty -
why nginx doesn't return $http_x_requested_with
when im making ajax request ? did need module compiled nginx make work ?
how can detect otherwise if request ajax in php-fpm ?
fastcgi_params:
fastcgi_param script_filename $document_root$fastcgi_script_name; fastcgi_param query_string $query_string; fastcgi_param request_method $request_method; fastcgi_param content_type $content_type; fastcgi_param content_length $content_length; fastcgi_param script_name $fastcgi_script_name; fastcgi_param request_uri $request_uri; fastcgi_param document_uri $document_uri; fastcgi_param document_root $document_root; fastcgi_param server_protocol $server_protocol; fastcgi_param request_scheme $scheme; fastcgi_param https $https if_not_empty; fastcgi_param gateway_interface cgi/1.1; fastcgi_param server_software nginx/$nginx_version; fastcgi_param remote_addr $remote_addr; fastcgi_param remote_port $remote_port; fastcgi_param server_addr $server_addr; fastcgi_param server_port $server_port; fastcgi_param server_name $server_name; # php only, required if php built --enable-force-cgi-redirect fastcgi_param redirect_status 200; fastcgi_param http_x_requested_with $http_x_requested_with;
vhost conf:
server { listen 80; server_name suzuki.sidormedia.pl; return 301 http://www.suzuki.sidormedia.pl$request_uri; } server { gzip on; gzip_disable "msie6"; gzip_comp_level 6; gzip_min_length 1100; gzip_buffers 16 8k; gzip_proxied any; gzip_types text/plain text/css text/js text/xml text/javascript application/javascript application/x-javascript application/json application/xml application/rss+xml image/svg+xml; listen 80; index index.php index.html index.htm; server_name www.suzuki.sidormedia.pl; access_log /var/www/suzuki/app/logs/suzuki-access.log combined; error_log /var/www/suzuki/app/logs/suzuki-error.log error; set $root_path '/var/www/suzuki/public/'; root $root_path; add_header 'access-control-allow-credentials' 'true'; add_header 'access-control-allow-origin' "http://www.suzuki.sidormedia.pl"; try_files $uri $uri/ @rewrite; location @rewrite { rewrite ^/(.*)$ /index.php?_url=/$1; } location ~ \.php$ { try_files $uri =404; fastcgi_split_path_info ^(.+\.php)(/.+)$; fastcgi_pass unix:/var/run/php/php7.0-fpm.sock; fastcgi_index index.php; fastcgi_param script_filename $document_root$fastcgi_script_name; include fastcgi_params; fastcgi_buffer_size 512k; fastcgi_buffers 512 32k; fastcgi_busy_buffers_size 512k; fastcgi_temp_file_write_size 512k; } location ~* \.(?:manifest|appcache|html?|xml|json)$ { expires -1; # access_log logs/static.log; # don't include static log } # feed location ~* \.(?:rss|atom)$ { expires 1h; add_header cache-control "public"; } # media: images, icons, video, audio, htc location ~* \.(?:jpg|jpeg|gif|png|ico|cur|gz|svg|svgz|mp4|ogg|ogv|webm|htc)$ { expires 1m; access_log off; add_header cache-control "public"; } # css , javascript location ~* \.(?:css|js)$ { expires 1y; access_log off; add_header cache-control "public"; } }
i dont know how post answer post answer, (mods?)
Comments
Post a Comment