希望对你来说nginx guru很简单。 我找不到任何有关谷歌或文档的相关信息,但我希望这是可能的。 从本质上讲,使用从其他人获得的build议,我们希望阻止PHP在我们的公共上传目录中运行。 我们正在完成这样的事情: if($uri !~ "^/vb_attach/") { fastcgi_pass 127.0.0.1:9005; } 但在这个网站上,我们有多个上传目录。 我知道nginx不支持&&或|| 在有条件的,所以我们试过这个: if ($uri !~ "^/vb_attach/") { if($uri !~ "^/vb_album/") { fastcgi_pass 127.0.0.1:9005; } } 但被告知第二个如果不允许那里。 那么我们该如何做到呢? 我们所要做的就是阻止PHP在这些上传目录中执行,以防万一有人能够绕过上传脚本中的检查。
我们有3台服务器。 一个是前端代理,然后是内部虚拟机。 前端/启用站点/默认 server { listen 80; rewrite ^(.*) https://$host$1 permanent; location / { proxy_pass http://10.10.0.56; proxy_redirect default; proxy_set_header Host $http_host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; } location /beta { proxy_pass http://10.10.0.63; proxy_redirect default; proxy_set_header Host $http_host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; } } 现在vm 10.10.0.63是新的。 我们想要并行运行两个系统。 新vm中有这样的老规矩。 10.10.0.63/site-enabled/default server { listen 80; […]
我在不同的端口上有两个独立的应用程序 #服务器A: 服务器{ 听80; server_name foobar.com; …#服务器特定的设置 } #服务器B: 服务器{ 听8081; server_name foobar.com; …#服务器特定的设置 } 我想为baz.foobar.com:80 foobar.com:8081添加“alias”。 我想我可能会实现这一点redirect或ServerB重复服务器configuration部分。 但是我正在寻找更加优雅和正确的解决scheme。
我迁移了我的木偶大师安装程序,从nginx提供的文件中运行。 模块文件服务很好,但插件文件似乎不工作。 这些日志认为代理正在请求url /production/file_content/plugins/puppet/provider/exec/powershell.rb ,因此nginx会抛出一个404,因为不存在这样的path。 这在WEBrick上正常工作。 从理论上讲,这应该是写一个类似于下面的模块规则的重写规则的简单情况。 但是,很多这些提供程序都在模块中,因此,此特定提供程序位于/etc/puppet/modules/powershell/lib/puppet/provider/exec/powershell.rb 。 如何从请求URL映射到实际的插件,当它们可以分散在各种模块目录? 我的nginxconfiguration如下所示: upstream puppetmaster-thin { server unix:/var/run/puppet/puppetmasterd.0.sock; server unix:/var/run/puppet/puppetmasterd.1.sock; server unix:/var/run/puppet/puppetmasterd.2.sock; } server { listen 8140; root /etc/puppet/rack; ssl on; ssl_session_timeout 5m; ssl_certificate /var/lib/puppet/ssl/certs/gcspuppet01.pem; ssl_certificate_key /var/lib/puppet/ssl/private_keys/gcspuppet01.pem; ssl_client_certificate /var/lib/puppet/ssl/ca/ca_crt.pem; ssl_crl /var/lib/puppet/ssl/ca/ca_crl.pem; ssl_verify_client optional; ssl_ciphers SSLv2:-LOW:-EXPORT:RC4+RSA; proxy_read_timeout 120; proxy_redirect off; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For […]
[在Stackoverflow上尝试了所有答案,并在google上search了很多,但没有一个configuration工作。] 我已经使用DigitalOcean上的指南在Fedora上安装了LEMP服务器( https://www.digitalocean.com/community/articles/how-to-install-linux–nginx-mysql-php-lemp-stack-on-centos- 6 )。 将nginx的default.conf中的example.comreplace为localhost。 然后,我使用这个( https://www.digitalocean.com/community/articles/how-to-install-phpmyadmin-on-a-lemp-server )安装了phpMyAdmin。 nginx的网页目录是/ usr / share / nginx / html 。 我为phpmyadmin创build了一个符号链接。 它在/ usr / share / nginx / html / phpMyAdmin 。 目前,我只需要本地主机访问( localhost / phpmyadmin )。 我能够访问本地主机和localhost / info.php。 我尝试了很多configuration,其中之一:Nginx的位置指令似乎没有工作。 我错过了什么吗? 但它不起作用。 有时我得到“没有指定input文件”。 其他时间404没有find。 我想要在localhost / phpmyadmin访问。 编辑:我的default.conf文件。 获取“没有指定的input文件”。 浏览器错误。 # # The default server # […]
我们构build了一个由以下path组成的Rails应用程序: namespace :api do namespace :v1 do resources … end end 这意味着所有的控制器都可以通过www.url.com/api/v1/controller进行访问。 要在根域下运行独立的web应用程序,我有以下本地nginx设置: server { listen 8080; server_name localhost; location / { root /Users/swramba/Sites; index index.html index.htm; } location ~ /api { proxy_pass http://127.0.0.1:3000; } } 这意味着, /api下的所有东西都被代理到用于开发的WEBrick服务器。 现在,在我们的生产环境中,我们想用类似的设置来使用Phusion Passenger。 所以,我为生产nginx写了下面的configuration文件: server { listen 80; server_name localhost; root /home/someuser/sites/web/www.myapp.com; passenger_base_uri /api; passenger_enabled on; rails_env production; […]
我想知道是否有可能使用GET参数在两台服务器之间做出决定。 谢谢
我试图安装nginx通过RVM在Ruby 2.0.0-p0上运行带有Passenger(4.0.0.rc5)的Rails站点(3.2.13)。 我已经成功安装了Passenger Gem,但是在运行时: rvmsudo passenger-install-nginx-module 在“编译乘客支持文件…”步骤中出现以下错误: g++ -o agents/PassengerHelperAgent.o -Iext -Iext/common -Iext/libev -Iext/libeio -D_REENTRANT -I/usr/local/include -DHAS_TR1_UNORDERED_MAP -DHAVE_ACCEPT4 -DHAS_ALLOCA_H -DHAS_SFENCE -DHAS_LFENCE -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wpointer-arith -Wwrite-strings -Wno-long-long -Wno-missing-field-initializers -ggdb -feliminate-unused-debug-symbols -feliminate-unused-debug-types -DPASSENGER_DEBUG -DBOOST_DISABLE_ASSERTS -fcommon -fvisibility=hidden -DVISIBILITY_ATTRIBUTE_SUPPORTED -Wno-attributes -c ext/common/agents/HelperAgent/Main.cpp g++: internal compiler error: Killed (program cc1plus) Please submit a full bug report, with preprocessed […]
在互联网中描述的很多变体如何用nginx显示维护页面。 但我没有find解决scheme来检查用户是否是开发人员,而不是显示开发人员的维护页面。 我使用try_files,这是不正常的,因为我需要任何中频部分input后。 所以我做了我自己的解决scheme,我想分享。 它可以在任何configuration中使用try_files,proxy等等。
我按照这个指令来安装gitlab: https : //github.com/gitlabhq/gitlabhq/blob/5-0-stable/doc/install/installation.md 一切都很好,直到#7。 nginx的。 我对这个特定的指令有问题 # Change **YOUR_SERVER_IP** and **YOUR_SERVER_FQDN** # to the IP address and fully-qualified domain name # of your host serving GitLab sudo vim /etc/nginx/sites-available/gitlab 我可以分别为YOUR_SERVER_IP和YOUR_SERVER_FQDN使用127.0.0.1和localhost吗? 我真的不想使用任何.com,这个gitlab将在内部使用。 当我访问本地主机时,它显示502坏的网关。 我的error_log文件内容 2013/03/24 09:18:21 [crit] 12152#0: *1 connect() to unix:/home/git/gitlab/tmp/sockets/gitlab.socket failed (2: No such file or directory) while connecting to upstream, client: 127.0.0.1, […]