这是驱使我坚果,我不明白这是如何工作自动。 我有nginx作为我的networking服务器,我已经安装了URL重写的Joomla从URL删除index.php 。 之前,当我使用Apache时,必须使用RewriteEngine On启用.htaccess才能使其工作。 但对于Nginx,当启用“使用URL重写”时,它会自动运行。 我只使用将php文件传递给php-fpm的Nginx。 就这样。 我没有添加任何特殊的重写规则,而不是Joomla文档中给出的。 我不明白“启用URL重写”是如何自动启用的,因为Nginx没有.htaccess。 关于这个主题的Joomla文档没有帮助。 它在第二步说 启用使用Apache mod_rewrite / URL重写选项并保存:此选项使用Apache mod_rewrite函数来消除URL的“index.php”部分。 ….. 如果此选项导致错误,请参阅如何检查您的服务器上是否启用了mod重写。 如果未启用,并且您有权访问文件apache / conf / httpd.conf,请打开该文件并检查LoadModule行rewrite_module modules / mod_rewrite.so是否未注释。 如有必要,取消注释该行并重新启动Apache Web服务器。 不知道为什么这是在Nginxconfiguration中添加的,因为在Nginx中没有mod_rewrite。 Joomla后端的URL重写如下: 使用URL重写select使用服务器的重写引擎来捕获满足特定条件的URL,并按照指示重写它们。 适用于IIS 7和Apache。 仅限Apache用户! 激活之前,将htaccess.txt重命名为.htaccess。 将web.config.txt重命名为web.config,然后在激活之前安装IIS URL重写模块。 它没有提到Nginx,但仍然有效。 我在这里挠着脑袋。 有人能告诉我Joomla的index.php如何轻松地在Nginx中删除? 这是我的Nginx Vhostconfiguration: server { listen 80; server_name example.com; root /var/www/example/public_html; index index.php index.html index.htm […]
我安装了Nginx和PHP5-FPM,并且一切正常,但是我注意到我安装了Nginx 1.2.1,而不是最新的稳定版本(1.6.x)。 我也注意到PHP-FPM有PHP 5.4而不是PHP 5.5。 但是,这不像旧的Nginx版本那么多的安全问题。 我如何安装: 添加deb http://nginx.org/packages/debian/ wheezy nginx到/etc/apt/sources.list 。 我也正确地添加了PGP密钥。 su apt-get update在更新期间列出了Nginx服务器,并且没有错误。 apt-get install nginx-extras php5-fpm 然后我configuration了两个我喜欢的。 我也意识到我有一个旧版本的Nginx。 我做了apt-cache show nginx-common ,看到了旧版本。 我试图apt-get upgrade无济于事。 apt-cache show nginx-common输出apt-cache show nginx-common : Package: nginx-common Source: nginx Version: 1.2.1-2.2+wheezy3 Installed-Size: 203 Maintainer: Kartik Mistry <[email protected]> Architecture: all Replaces: nginx (<< 0.8.54-4), nginx-extras (<< 0.8.54-4), […]
我有一个在Ubuntu 14.04上运行的nginx/1.4.6 ,但是在一个chroot Ubuntu 9.10 (Karmic Koala)里面有一个php/5.2.10的场景。 我的问题是,所有的PHP文件请求导致恐惧的“ No input file specified. 我把这个站点存放在chroot里面,所以它可以从chroot jail里的php和jail以外的nginx里读取。 From nginx' point of view: /var/chroot/karmic/var/www/domains/dummysite/web: . www-data:www-data drwxr-xr-x index.php www-data:www-data -rw-r–r– test.jpg www-data:www-data -rw-r–r– 并在chroot里面 From php's point of view: /var/www/domains/dummysite/web: . www-data:www-data drwxr-xr-x index.php www-data:www-data -rw-r–r– test.jpg www-data:www-data -rw-r–r– 和index.php是死的简单! <?php echo '<h1>Hello World</h1> Foo bar…'; ?> 我已经用lighttpd的spawn-fcgi用这个命令启动了php-fcgi: LANG=C […]
我有一个proxy_pass工作/,并希望某些configuration只适用于根。 我试过了 location / { proxy_pass http://foo.com/ } location = / { subs_filter 'foo' 'bar'; } 但我从foo.com得到404 – 我将如何使subs_filter只适用于根?
通常我在nginx config规则中不允许caching所有的XMLHttpRequest: map $http_x_requested_with $nocache_01 { default 0; XMLHttpRequest 1; } 有没有办法caching只有GET Ajax请求?
这个问题可能会问很多次,我一直在阅读,但仍然不能得到我想要的。 我有一个应用程序运行在http://172.17.1.10:8080/myapp我想设置nginx反向代理访问应用程序使用http://sub.domain.com只隐藏“myapp”在地址栏中。 我目前的设置是: server{ listen 80; server_name sub.domain.com; location /myapp { rewrite ^/myapp(.*) /$1 break; proxy_pass http://172.17.1.10:8080; proxy_redirect off; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; include /etc/nginx/proxy_params; } } 但是我一直使用http://sub.domain.com和http://sub.domain.com/myapp查看Nginx的索引页面。 我错过了什么?
我正在一个数字海洋滴运行nodejs应用程序,我正在尝试configurationnginx,以便它代理我的应用程序正在运行的端口端口, 这是我在我的站点上的默认文件可用 server { listen 80 default_server; listen [::]:80 default_server ipv6only=on; root /prwrite; index index.html index.htm app.js; # Make site accessible from http://localhost/ server_name http://www.xxx.xxxxx.com; location / { proxy_pass http://www.xxx.xxxx.com:3000/; proxy_redirect off; proxy_set_header Host $host; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; } # Only for nginx-naxsi used with nginx-naxsi-ui : process denied requests #location /RequestDenied { # proxy_pass […]
我想要phpMyAdmin在另一个端口下运行,并通过/pma/到127.0.0.1:8081所有请求 那是我的Nginxconfiguration server { listen 80; … location /pma/ { proxy_pass http://127.0.0.1:8081/; proxy_redirect off; proxy_set_header Host $host; } location ~ \.php$ { … } } 现在,当我请求http://domain.com/pma/phpinfo.php location ~ \.php$接pipe控制,我得到了404。是否有可能总是将请求传递到http://127.0.0.1:8081何时到/pma/ ?
考虑这个configuration(给/foo不存在): server { set $x 1; location = / { set $x 0; try_files /foo @l; } location / { try_files /foo @l; } location @l { set_header X $x; proxy_pass http://localhost:1000/; } } 即使我导航到/时,响应标题X始终为1 。 为什么是这样的,我怎样才能让variables通过try_files传播?
我试图从URL的选项IDredirect到URL的选项URL_key我已经分配。 我有两个列ID与ID我想replace和URL_key作为替代。 11337酒吧11419餐厅11399咖啡厅15477绘画 我现在有这些url: ifab.ru/art/kartiny/location/11399/style/15477 我想redirect到: ifab.ru/art/kartiny/location/cafe/style/painting 你可以说我可以把网站上的所有url都replace成replaceurl,但是它们是自动生成的,而且每个url的组合可能都不一样,所以我想抓住这个ID并把它改写成URL_key。 任何想法和解决scheme,赞赏。 我们在nginx上运行我们的服务器,没有apache。