有人知道如何在 nginx 服务器的配置文件中配置 server {} 吗?
我有下面这样的东西:
server {
server_name local.com;
root some_path;
index index.php;
#location / {
#try_files $uri $uri/ index.php;
#proxy_pass http://127.0.0.1:9000;
#}
# set a nice expire for assets
#location ~* "^.+\.(jpe?g|gif|css|png|js|ico|pdf|zip|tar|t?gz|mp3|wav|swf)$" {
# expires max;
# add_header Cache-Control public;
#}
# the downloader has its own index.php that needs to be used
#location ~* ^(/downloader|/js|/404|/report)(.*) {
# include fastcgi_params;
# fastcgi_index index.php;
# fastcgi_param SCRIPT_FILENAME $document_root$1/index.php$1;
# fastcgi_read_timeout 600;
# fastcgi_pass 127.0.0.1:9000;
#}
location ~* \.php {
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_read_timeout 18000;
fastcgi_pass 127.0.0.1:9000;
}
#location ~* ^(/index.php)?(.*) {
# include fastcgi_params;
# fastcgi_param SCRIPT_FILENAME $document_root/index.php$1;
# fastcgi_pass 127.0.0.1:9000;
# fastcgi_read_timeout 18000;
#}
}
浏览器返回空白页面并且不执行 php...
EDIT:
在花了一些时间进行 nginx 配置和 php 内容之后,我最终得到了一个网站,该网站在某些情况下可以正确加载,而在某些情况下则不能...
前任:
我有两个相同的页面,但由于某种原因,第一个是加载一个魅力,第二个是部分加载......
有时页面加载到一半...
Nginx 没有记录任何内容...
由于某种原因,当我尝试访问后端时,nginx 使用后端 url 加载前端:/
有人可以为我提供其他 magento 1.8 配置吗?
之后index
指令(实际上在哪里并不重要,只是为了易读)添加一个尝试文件指示。
try_files $uri $uri/ /index.php;
一次偶然的机会,我就此写了一份更全面的指南:为 Magento 配置 nginx
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)