所以我最近一直在试图通过构build一个基于pimcore的nginx vhostconfiguration来帮助社区。 除了一个小问题之外,一切工作都很好。 如果任何页面(cms页面)使用rss提要作为实例,并且rss提要返回503错误(不可用/ 404等),则整个页面被转发到503/404错误页面,而不是仅仅禁用项目。 这个问题不会显示在Apache上。 发生的问题可以说,例如,/ about是一个cms页面,其中包括rss提要。 关于页面是有效的,但是消耗的并且将在页面中显示的馈送返回503错误。 Nginx似乎正在拾取包含的资产,并将顶层页面(/ about)redirect到错误页面,而不是渲染大部分页面。 configuration是有点肮脏的,但完全正常工作,因为我已经尝试了许多不同的事情,使其工作,但我找不到正确的configuration集来解决这个问题。 设置内部; / / .php位置内的值也不会改变任何内容。 如果有人可以帮助我解决这个问题,那么我可以在保存实际的文档根目录之前,将其重新添加到社区文档中。 标准的虚拟主机使用: server { listen 80; server_name _; root /data/www/pimcore; access_log /var/log/nginx/$host-access.log; error_log /var/log/nginx/pimcore-error.log debug; include /etc/nginx/conf.d/_tpl/pimcore.cf; } 我通过虚拟主机加载的pimcore.cf文件如下所示: index index.php index.html index.htm; location ~* \.(js|css|png|jpg|jpeg|gif|ico|xml|swf|flv|eot|ttf|woff|pdf|xls|htc)$ { access_log off; log_not_found off; expires 360d; add_header Pragma "public"; add_header Cache-Control "public, […]
我正在使用nginx上传进度扩展和一些重写子句。 一切正常,只要我上传表单上传到一个PHP文件( <form action="myphpfile.php" … > )。 但是当我在我的动作参数( <form action="myhtmlfile.htm" …> )中使用html文件时,我只通过请求上传状态来获得“({status:starting})”。 但是…我所有的网页都是从htm改写为php,使用我的nginx-conf中的以下位置部分: location ~ \.(php|htm)$ { rewrite ^/([a-zA-Z0-9]+).htm$ /index.php?page=$1 last; client_max_body_size 0; include /etc/nginx/fastcgi_params; track_uploads uploads 30s; } 我的位置或重写条款有什么问题吗? 但是…这些组合适用于其他任何东西,所以我目前有点困惑,为什么我只通过在窗体的action-parameter中使用php-files来获得正确的状态。 编辑:我的完整configuration如下: user nginx; worker_processes 1; error_log /var/log/nginx/error.log warn; pid /var/run/nginx.pid; events { worker_connections 1024; } http { include /etc/nginx/mime.types; default_type application/octet-stream; log_format main '$remote_addr […]
我第一次尝试压力testing一个简单的django web应用程序,运行在gunicorn和nginx上,我把它放在一个小型的256MB Rackspace Cloud服务器上。 使用httperf,我增加每秒的连接数,直到我开始得到错误例如 httperf –hog –server=localhost –uri=/myapp –timeout=10 –num-conns=2500 –rate=25 我发现,从Django几乎静态页面,我可以得到约35 req /秒之前,错误开始被抛出。 对于需要数据库查询和更多处理的更加dynamic的页面,我可以获得大约25次/秒。 最初我只使用1个gunicorn worker,但增加到4个worker(我认为我的云服务器有4个内核)似乎没有任何区别(它仍然开始抛出25 req / sec以上的错误)。 这些结果听起来像预期的一样,考虑到这是一个如此小(256MB)的服务器上运行? 另外,是否有任何改变,我可以提高吞吐量?
在一台机器上有一个博客(apache)(目前在blog.domain.com),我们想把它移到domain.com/blog。 dns for domain.com指向haproxy机器负载均衡几个nginx应用服务器。 托pipe博客的计算机不在该负载均衡器后面。 考虑到我完全控制了一切的configuration,最简单的方法是把它提交给我的意愿,并有从domain.com/blog提供的博客?
我有以下configuration: Nginx>清漆> Gunicorn> Django 我想caching与同一个网站(移动和networking)的2个版本与清漆。 Gunicorn: WEB: gunicorn_django –bind 127.0.0.1:8181 MOBILE: gunicorn_django –bind 127.0.0.1:8182 Nginx的: WEB: server { listen 80; server_name www.mysite.com; location / { proxy_pass http://127.0.0.1:8282; # pass to Varnish proxy_set_header X-Real-IP $remote_addr; proxy_set_header Host $host; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; } } 移动: server { listen 80; server_name m.mysite.com; location / { proxy_pass http://127.0.0.1:8282; # […]
如果你想通过基于位置的proxypass代理URL请求到两个不同的后端,最快和最干净的解决scheme是什么。 location /app1/ { alias /var/www/ruby/public; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header Host $http_host; proxy_redirect off; try_files $uri $uri/ @ruby; } location @ruby { proxy_pass http://127.0.0.1:3000; } location /app2/ { proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header Host $http_host; proxy_redirect off; try_files $uri $uri/ @other; } location @other { proxy_pass http://127.0.0.1:8080; } 有了这个configuration,nginx将"/app1"或“ /app2 […]
我已经在我的服务器上安装了gitlab,并使用nginx作为http服务器…我简单地在nginx上使用gitlab的配方 # GITLAB # Maintainer: @randx # App Version: 3.0 upstream gitlab { server unix:/home/gitlab/gitlab/tmp/sockets/gitlab.socket; } server { listen 192.168.250.81:80; # eg, listen 192.168.1.1:80; server_name gitlab.xxx.com; # eg, server_name source.example.com; root /home/gitlab/gitlab/public; # individual nginx logs for this gitlab vhost access_log /var/log/nginx/gitlab_access.log; error_log /var/log/nginx/gitlab_error.log; location / { # serve static files from defined root folder;. […]
我正在尝试设置一个非常简单的nginxconfiguration来提供静态内容。 这是我的configuration设置。 每当我尝试访问一个不存在的文件而不是404时,我得到HTTP 500.请让我知道我在做什么错了? 2012/12/21 11:15:14 [error] 1906#0:* 41在内部redirect到“/index.html”时客户端:127.0.0.1, :“GET /favicon.ico HTTP / 1.1”,主机:“i.domain.com” server { listen 127.0.0.1:81; ## listen for ipv4; this line is default and implied root /project/; index index.html index.htm; location ~* \.(jpg|jpeg|gif|png|css|js|ico|xml)$ { access_log off; log_not_found off; expires 360d; } server_name i.domain.com; location / { try_files $uri $uri/ /index.html; } error_page […]
我试图将一个非常简单的.htaccess文件转换为nginx: Options -Indexes -MultiViews RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^ index.php [L] 正如我在谷歌和许多地方阅读,try_files应该做的伎俩。 我尝试了很多东西,但它只是不起作用,看起来像没有发送到index.php server { root /var/www/html/; location / { index index.php; try_files $uri $uri/ /index.php?$args; } location ~ \.php$ { fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; include fastcgi_params; } } 文件结构很简单: /var/www/html/folder1/folder2/index.php /var/www/html/folder1/folder2/.htaccess 请求URL时的Nginx错误日志: 013/01/17 14:38:28 [error] 22379#0: *1 FastCGI sent […]
我有一个运行在Vagrant开发环境中的Wordpress网站。 当我加载http://localhost:8080 ,该网站出现的很好,但只要我尝试通过访问http://localhost:8080/wp-admin ,我被redirect到http://localhost/wp-admin/ 。 这里有两件事情: Nginx正在强制执行尾部的斜线(我不是故意的,afaik,但可以)。 在尾部的斜线redirect中,端口正在丢失(这是非常不好的)。 我已经尝试添加port_in_redirect指令(使用两个值,说实话),我已经看到类似问题的其他答案,但它没有改变。 任何想法我失踪?