با سلام
دوستان من روی یه وی پی اس nginx نصب کردم ، منتهی فایل هایی که توی روت دایرکتوری ریختم رو روی بروزر اجرا نمیکنه و ارور not found میده
سیستم عامل centos هست .
کانفیگ هاست nginx :
یه فایل phptest.conf هم گذاشتم با تنظیمات زیر :کد HTML:server { listen 80; index index.php; server_name www.domain.ir domain.ir; access_log /var/log/nginx/domain.ir-access.log; root /website/user; error_log /var/log/nginx/domain.ir-error.log; error_page 404 /search404; add_header X-Frame-Options SAMEORIGIN; add_header X-Content-Type-Options nosniff; add_header X-XSS-Protection "1; mode=block"; add_header Content-Security-Policy "default-src 'self'; script-src 'self' 'unsafe-inline' 'unsafe-eval' https://ssl.google-analytics.com https://assets.zendesk.com https://connect.facebook.net; img-src 'self' https://ssl.google-analytics.com https://s-static.ak.facebook.com https://assets.zendesk.com; style-src 'self' 'unsafe-inline' https://fonts.googleapis.com https://assets.zendesk.com; font-src 'self' https://themes.googleusercontent.com; frame-src https://assets.zendesk.com https://www.facebook.com https://s-static.ak.facebook.com https://tautt.zendesk.com; object-src 'none'"; server_tokens off; ## All other errors get the generic error page ## error_page 400 401 402 403 405 406 407 408 409 410 411 412 413 414 415 416 417 495 496 497 500 501 502 503 504 505 506 507 /error_page.html; location /search404 { internal; } location / { set_real_ip_from 127.0.0.1; real_ip_header X-Forwarded-For; location = /robots.txt { access_log off; log_not_found off; try_files $uri @drupal; } location ~* ^.*(\.(?:engine|inc|info|install|make|module|profile|test|po|sh|.*sql|theme|tpl(\.php)?|xtmpl|svn-base|txt|htaccess)$|^(code-style\.pl|Entries.*|Repository|Root|Tag|Template|all-wcprops|entries|format))$ { deny all; error_page 403 =404; } try_files $uri @drupal; expires 10m; } location @drupal { set_real_ip_from 127.0.0.1; real_ip_header X-Forwarded-For; set $user_flag ""; if ($http_x_forwarded_proto != https) { set $user_flag "${user_flag}A"; } if ($remote_addr !~ ^(ips)) { set $user_flag "${user_flag}C"; } if ($user_flag ~ BC) { rewrite ^/(.*) http://$host:80 last; break; } if ($user_flag = AB) { # rewrite ^/(.*) https://$host$uri break; # break; } set $user_flag ""; if ($http_x_forwarded_proto = https) { set $user_flag "${user_flag}M"; } if ($http_cookie ~ SESS) { set $user_flag "${user_flag}O"; } if ($http_cookie !~ SESS) { set $user_flag "${user_flag}P"; } if ($user_flag ~ MNQ) { rewrite ^/(.*) http://$host$uri break; break; } if (!-e $request_filename) { rewrite ^/(.*)$ /index.php?q=$1 last; } } location ~ ^/(install|cron|update).php$ { allow ips; allow ips; error_page 403 =404; expires off; root /website/user/; fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; include fastcgi_params; deny all; } # php file handling location ~ .php$ { root /website/user/; fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; include fastcgi_params; } }
تو دایرکتوری بالا فایل phpinfo رو لود میکنه ، مشکل کانفیگ کجاست ؟کد HTML:server { listen 80; # listen port server_name 192.168.80.3; # Server name (www.krizna.com) add_header X-Frame-Options SAMEORIGIN; add_header X-Content-Type-Options nosniff; add_header X-XSS-Protection "1; mode=block"; add_header Content-Security-Policy "default-src 'self'; script-src 'self' 'unsafe-inline' 'unsafe-eval' https://ssl.google-analytics.com https://assets.zendesk.com https://connect.facebook.net; img-src 'self' https://ssl.google-analytics.com https://s-static.ak.facebook.com https://assets.zendesk.com; style-src 'self' 'unsafe-inline' https://fonts.googleapis.com https://assets.zendesk.com; font-src 'self' https://themes.googleusercontent.com; frame-src https://assets.zendesk.com https://www.facebook.com https://s-static.ak.facebook.com https://tautt.zendesk.com; object-src 'none'"; server_tokens off; location / { root /usr/share/nginx/html; # Document root index index.php index.html index.htm; } location ~ \.php$ { root /usr/share/nginx/html; # Document root fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; include fastcgi_params; } }
توی ارور لاگ هم مورد زیر مشاهده میشه :
2015/07/26 10:32:24 [error] 4456#0: *11 FastCGI sent in stderr: "Primary script unknown" while reading response header from upstream, client:
راه حل چیه ؟ کسی از دوستان به این مشکل خورده تاحالا ؟
ممنون





پاسخ با نقل قول