在我的窗口成功设置nginx后,另一个问题,我卡住了。 尽pipe如此,一切正常。 我能够访问页面和PHP工作正常,但是当我尝试使用Codeignitertypes的URL,我的意思是, https://localhost/index.php/<controller> 即使我在“index.php”之后插入一个斜线,也No input file specified ,我认为这意味着FastCGI服务器无法捕获正确的文件。 这是我的configuration文件, server { server_name localhost; listen 443; root /wamp/www/; ssl on; ssl_certificate /wamp/www/server.crt; ssl_certificate_key /wamp/www/server.key; location / { index index.php index.html index.htm; } location /NavHawk2 { try_files $uri $uri/ index.php/; } # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000 # location ~ \.php$ […]
我有一个多语言站点,每个语言都有子站点。 我想使用子域作为我的自定义静态错误页面的名称的一部分。 例 error_page 404 error/$subdomain.not_found.html
我想configuration我的lighttpd来提供一些具有压缩function的静态文件。 这些文件是纯文本,但它们有.bin扩展名。 我有我的lighttpdconfiguration这些行: compress.cache-dir = "/var/cache/lighttpd/compress/" compress.filetype = ("text/plain", "text/html", "application/x-javascript", "text/css") 它适用于css和js文件,但不适用于.bin文件。 下面是这些.bin文件的file -i的输出: 8_1.bin: text/plain; charset=us-ascii 我怎样才能确定这个文件的文件types相同的方式lighttpd呢?
我有三个LXC容器(CN1,CN2,CN3)。 他们各自运行自己的Apache实例并拥有自己的networking,因此每个容器都有自己的私有IP。 我设置了所有的容器来侦听专用于Apache的私有IP。 我还设置了Nginx作为主机的代理,根据请求的域来引导任何stream量。 所以我有web1 – > CN1(10.0.3.2),web2 – > CN2(10.0.3.3),web3 – > CN3(10.0.3.4)。 当我去到web1时,它显示了正确的页面。 当我去到web2时,它显示了正确的页面。 但是,当我去到web3时,它显示了web2的页面。 这是我的Nginx服务器configuration: WEB2 服务器{ server_name web2; 位置 / { proxy_set_header X-Real-IP $ remote_addr; proxy_set_header主机$主机; proxy_set_header X-Forwarded-For $ proxy_add_x_forwarded_for; proxy_pass http://10.0.3.3:802; } } WEB3 服务器{ server_name web3; 位置 / { proxy_set_header X-Real-IP $ remote_addr; proxy_set_header主机$主机; proxy_set_header X-Forwarded-For $ proxy_add_x_forwarded_for; proxy_pass […]
任何人都知道如何重写这个Apache的Nginx规则? RewriteRule .* – [E=HTTP_IF_MODIFIED_SINCE:%{HTTP:If-Modified-Since}] RewriteRule。* – [E = HTTP_IF_NONE_MATCH:%{HTTP:If-None-Match}] 谢谢
是否有可能为nginx中的所有虚拟主机( server )设置expires ,同时仍然过滤文件types? 现在我正在使用 location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg|woff|otf|ttf) { expires 1y; } 但我只能把location在一个server而不是http 。
我有一个nginx重写的麻烦。 我想重写^(.*?)/(.*?)/?$到controllers/$1.php?action=$2 。 这在早些时候在Apache服务器上工作。 之后,我想把这个文件路由到php-fastcgi。 对于一个正常的请求(即当我input完整path,而不使用重写),php-fastcgi正常工作。 我的configuration: server { listen [::]:80; root /var/www/my-dir; index index.php index.html index.htm; charset utf-8; server_name my-domain; location / { autoindex off; rewrite ^(.*?)/(.*?)/?$ controllers/$1.php?action=$2 last; } location ~ \.php$ { fastcgi_split_path_info ^(.+\.php)(/.+)$; fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; include fastcgi_params; } location ~ /\. { deny all; } } 编辑完这个configuration之后,我做了一个service nginx restart […]
在Apache / cPanel中,我可以设置MinSpareServers和MaxSpareServers的数量。 但是闲置过程的用户是没有人的。 我正在运行SuPHP,PHP正在CGI下运行。 那么,如果我为我的繁忙网站增加最小/最大备用服务器号码,它会影响CGI / SuPHP吗? 还是只有在没有人的情况下才能提高DSO的速度? (我使用Nginx作为代理来处理静态文件) 如果我可以在Google上search这个问题,我不需要在这里问。
我试图强制Nginxredirect/重写一个使用查询string/?cat = 20到/ category / lighttpd /的URL。 这是我试过的,这是不工作的: location ~ /\?cat=20 { rewrite ^ http://kevinworthington.com/category/lighttpd/? permanent; } 我首先尝试了第一行: location ~ /?cat=20 { 但是这对我也不起作用。 这是使用WordPress作为CMS,如果这有什么区别。 您的帮助或提示表示赞赏。 谢谢。
我们有nginx设置了大约5个域名。 每个域都有与之相关的特定IP。 当一个请求到达一个IP时,nginx将这个请求引导到相关的站点,而不pipe这个请求来自哪个域。 例如,我们的网站是parent.com,位于192.168.1.1。 child.com的Alogging指向192.168.1.1。 因此,nginx会将所有对child.com的请求发送给parent.com(Parent.com正在运行一个SaaS设置并自动检测到所请求的域)。 这一切都很好。 我们现在要做的是为每个域定义一个独立的日志文件。 现在我们的configuration文件定义了一个静态的日志位置。 我们要修改这个,以便根据访问的域设置日志位置。 我们目前的日志指令: access_log /home/parent/_logs/access.log; error_log /home/parent/_logs/error.log;