我有以下的Apache重写规则,我试图转换为与Nginx的工作。 RewriteRule ^(.*)\/(.*)-(\d{4})(?:-(.*))?$ album.php?artist=$1&album=$2&releaseyear=$3&extra=$4 我希望它只是 location / { rewrite "^/(.*)\/(.*)-(\d{4})(?:-(.*))?$" /album.php?artist=$1&album=$2&releaseyear=$3&extra=$4; } 虽然这不起作用,但是我的重写规则的nginx版本有没有明确的问题?
我有一台运行Apache的Ubuntu服务器,它托pipe着一个使用HTTP访问的Wordpress站点。 还有Nginx安装了一个只能使用HTTPS访问的Django站点。 现在,我想要完成的是example.com和www.example.com将转到由Apache托pipe的Wordpress,而api.example.com将转到由Nginx托pipe的Django。 如果我只是尝试访问api.example.com主页api.example.com ,但目前还api.example.com ,但有一个奇怪的问题:当我尝试访问api.example.com/adminpipe理面板)时,页面被redirect到WordPress的pipe理login页面www.example.com/wp-admin 。 这是为什么? 我甚至尝试将Djangopipe理面板的URL更改为别的。 这反过来导致Wordpress 404页面(“哎呀,那个页面找不到!”)。 所以,域后的URL部分似乎被Apache劫持了,即使它在不同的子域中。 是什么原因造成的,我该如何解决? Apache网站configuration如下: <VirtualHost *:80> ServerName www.example.com DocumentRoot /var/www/wp <Directory /var/www/wp> Options Indexes FollowSymlinks MultiViews AllowOverride All Order allow,deny allow from all </Directory> </VirtualHost> 而Nginx的网站是这样configuration的: upstream app_server { server unix:/tmp/gunicorn.sock fail_timeout=0; } server { listen 443 ssl; charset utf-8; server_name api.example.com; ssl on; # […]
一切运作良好,但我在扩展页面时遇到与WordPress的问题。 问题是,没有图片显示每个插件,当我点击巫婆插件的图片,我想要安装其打开窗户,但不显示图案,只是无限加载…但是,当我点击“安装button“,它安装好插件 你可以看这个图像看看会发生什么 发出Wordpress 这里的configuration: configuration 这里的networking服务器configuration: 前端Nginx server { listen 443 ssl; # SSL ssl on; ssl_certificate /etc/ssl/nginx/nginx.crt; ssl_certificate_key /etc/ssl/nginx/nginx.key; ssl_session_cache shared:SSL:40m; ssl_session_timeout 10m; ssl_protocols TLSv1 TLSv1.1 TLSv1.2; ssl_prefer_server_ciphers on; server_name domaine.tld; # Proxy Pass to Varnish and Add headers to recognize SSL location / { proxy_pass http://127.0.0.1:80; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Host $host; […]
我正在运行一个Ubuntu OS 14.04托pipeNginx的Zend服务器和Apache监听不同的端口。 我设法安装Zend Server没有任何麻烦。 为了在Nginx旁边运行Apache,我已经使用apt-get install apache2手动设置了它,并启用了PHP。 基本上我有两个php.iniconfiguration文件在机器上。 我遇到的麻烦是试图在Apache / PHP安装中安装mysql类。 我尝试运行apt-get install php5-mysql ,并且最终下载了Zend Server php.iniconfigurationphp.ini ,破坏了Zend。 有谁知道如何指定哪个PHP文件来添加扩展名? 另外,我尝试将Zend中可用的mysql扩展连接到apache2 php.ini文件中,如下所示: extension = /usr/lib/php5/20121212/mysql.so; 但是这不起作用。 总结一下:Zend Server对于所有的mysql/mysqli类都很mysql/mysqli 。 PHP在apache2上运行,但没有访问mysql/mysqli类。 如有必要,我可以发布configuration文件的细节。
有时你必须重写Nginx中用于某些请求的fastcgi_param SCRIPT_FILENAME 。 但是,如果fastcgi_param SCRIPT_FILENAME是包含在你的Nginxconfiguration中的fastcgi.conf等包含文件的一部分,那么把fastcgi_param SCRIPT_FILENAME从那里拉出来,然后把它放到你的主configuration文件中,只是为了覆盖它一个地方。 通常fastcgi_param SCRIPT_FILENAME的值为$document_root$fastcgi_script_name所以重写$fastcgi_script_name将是一个完美的解决scheme。 但文档说这是一个embedded式variables,所以没有办法覆盖它? 这将是好的,如果它的工作,但它不: location /example { root = /files/example_files; fastcgi_script_name = special.php; include fastcgi.conf; } 也不是这样: location /example { root = /files/example_files; set $fastcgi_script_name special.php; include fastcgi.conf; } 错误信息是: 重复的“fastcgi_script_name”variables
我正在运行一个nginx服务器(1.8.0),我想听ipv4和ipv6。 但即使有正确的监听语句(当然重新启动nginx) netstat -tlp | grep nginx netstat -tlp | grep nginx返回 tcp 0 0 *:http *:* LISTEN 24720/nginx -g daem tcp 0 0 *:https *:* LISTEN 24720/nginx -g daem 我已经尝试了不同的listen语句组合(ipv6only = off,只有[::]:443)? 我错过了什么? 这里是我的configuration: upstream foo { server localhost:8000; } server { listen 80; listen [::]:80; server_name www.foo.net foo.net foo.com www.foo.com; rewrite ^ https://www.foo.com$request_uri? […]
以下问题仅在使用Laravel的@include将其他刀片模板添加到主布局时才会发生: /etc/nginx/error.log 在读取来自上游的响应标题时,客户端:192.168.33.1,服务器:dev.com,错误3374#0:* 1 recv()失败(104:请求:“GET / HTTP / 1.1”,上游:“fastcgi:// unix:/var/run/php5-fpm.sock:”,主机:“local.dev.com” 2015/06/25 23:42:34 [error] 3374#0:* 1 open()“/usr/share/nginx/www/50x.html”failed(2:No such file or directory),client:192.168 .33.1,server:dev.com,请求:“GET / HTTP / 1.1”,上游:“fastcgi:// unix:/var/run/php5-fpm.sock”,主机:“local.dev.com” php5-fpm.log不报告任何问题 我已经尝试过了: opcache.enable=0 proxy_buffer_size 128k; proxy_buffers 4 256k; proxy_busy_buffers_size 256k; proxy_connect_timeout 600s; proxy_send_timeout 600s; proxy_read_timeout 600s; fastcgi_send_timeout 600s; fastcgi_read_timeout 600s; 没有什么帮助,迄今。 只有当我从模板中删除@include。 我用: laravel 5.1 stream浪汉 nginx 1.4.6 PHP5-FPM […]
我试图清理我的反向代理nginxconfiguration我的url。 我的configuration看起来像这样 upstream blog { ip:port; } server { listen 80; server_name domain.tdl www.domain.tdl; rewrite ^/index.html$ / redirect; rewrite ^(/.+)/index.html$ $1 redirect; if ($request_uri ~* ".html") { rewrite (?i)^(.*)/(.*)\.html $1/$2 redirect; } location / { rewrite ^/(.*) /$1 break; proxy_pass http://blog; } } 只要我博客上的端口是80,一切正常。 但是,如果我改变了其他的东西,nginx会尝试将我的请求redirect到domain.tdl:port,这显然不起作用。 我厌倦了proxy_set_header和proxy_redirect的许多组合,但没有为我工作。 根据要求更多的细节,所有的输出都来自curl -Lv : 我将ip:port设置为ip:8000 < HTTP/1.1 301 Moved Permanently […]
有人可以请解释我怎么可以让nginx重新在它的自己的子文件夹下的magento中的商店视图。 我有一个商店..以下代码在我的nginxconfiguration文件。 location ~ \.php$ { fastcgi_split_path_info ^(.+\.php)(/.+)$; include /etc/nginx/fastcgi_params; fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; fastcgi_param MAGE_RUN_CODE edu_default; fastcgi_param MAGE_RUN_TYPE store; fastcgi_connect_timeout 60; fastcgi_send_timeout 180; fastcgi_read_timeout 180; fastcgi_buffer_size 256k; fastcgi_buffers 4 256k; fastcgi_busy_buffers_size 256k; fastcgi_temp_file_write_size 256k; fastcgi_intercept_errors on; fastcgi_param SCRIPT_FILENAME /home/domain here/public_html$fastcgi_script_name; } 我有我的所有magento文件在根文件夹:/ home / domain here / public_html 现在我有一个存储视图,可以通过一个子文件夹/ substore / 但我希望它从根文件夹magento index.php文件运行。 但是所有的链接仍然有URL中的子文件夹。 […]
我已经build立了一个使用Nginx的本地Git服务器(在Ubuntu中),现在我想授权用户使用外部的Python脚本,这应该授权他们对预定义的数据库。 AFAIK,我必须使用uwsgi链接Python脚本与Nginx,但是没有例子显示我应该如何实现这一点。 任何帮助?