我的服务器运行在Ubuntu 16.04上,Nginx。 当我在服务器上input命令mongo ,我有这个警告: Server has startup warnings: 2016-07-31T16:59:14.390+0200 I CONTROL [initandlisten] 2016-07-31T16:59:14.391+0200 I CONTROL [initandlisten] ** WARNING: Cannot detect if NUMA interleaving is enabled. Failed to probe "/sys/devices/system/node/node1": Permission denied 2016-07-31T16:59:14.391+0200 W CONTROL [initandlisten] 2016-07-31T16:59:14.391+0200 W CONTROL [initandlisten] Failed to probe "/sys/kernel/mm/transparent_hugepage": Permission denied 2016-07-31T16:59:14.391+0200 W CONTROL [initandlisten] 2016-07-31T16:59:14.391+0200 W CONTROL [initandlisten] Failed to […]
我需要让PHP 5和7同时工作,因为需要使用两个仅针对版本5和7的PHP扩展。 我已经与Nginx合作了,通过将PHP 5扩展调用的页面命名为page.php5,并具有如下的位置块: location ~ \.php5$ { include snippets/fastcgi-php.conf; fastcgi_pass unix:/var/run/php5-fpm.sock; } location ~ \.php$ { include snippets/fastcgi-php.conf; fastcgi_pass unix:/var/run/php/php7.0-fpm.sock; } 工作正常。 但是如何用Apache做同样的事? 我已经读过有不同的虚拟主机,一个使用PHP模块,一个使用fast-cgi,但理想情况下,我宁愿有更接近上述定位方法的东西,只有一个主机。 可以这样做吗? 谢谢。
我想在服务器上安装一个Magento平台。 我使用Centos和nginx,并希望redirect所有http连接到https我已经在nginx domain.conf上设置了一个http httpsredirect,并且这些工作正常,但我怎样才能确保所有的连接是安全的。 我问,因为如果我也使用HSTS的第一个请求可能仍然是http。 我的example.org.conf文件的审查 server { listen 80 default_server; listen [::]:80 default_server; server_name example.org www.example.org; return 301 https://$server_name$request_uri; } server { #listen 80 reuseport; #listen 443 http2 ssl reuseport; listen 443 ssl; #listen 80; … … } 所以我又怎么能确定所有的连接都是安全的呢? 我问的第二个原因是我注意到,如果我打开与移动数据速度慢的智能手机的域名,它开始只是第二个不安全的url或我只是错了? 希望你能给我一个build议
我想根据path将请求redirect到不同的服务器,因此我在Nginxconfiguration中使用了以下http块: http { include /etc/nginx/mime.types; default_type application/octet-stream; index index.html index.htm; server { access_log /var/log/nginx/staging.access.log main buffer=32k; error_log /var/log/nginx/staging.error.log error; listen 80; root /dev/null; location / { proxy_pass http://core:80; # returns "Core Service" } location /page/ { rewrite ^/page(/.*)$ $1 break; proxy_pass http://page:80; # returns "Page Service" } location /auth/ { rewrite ^/auth(/.*)$ $1 break; proxy_pass […]
我需要在nginx上redirect特定的path,但无法find方法:)特别是redirect301这个url http://www.domain.com/c/Integratori-di-Proteine/Universal-.html http://www.domain.com/c/Integratori-Aminoacidi/+Watt.html 分别 http://www.domain.com/c/Integratori-di-Proteine/ http://www.domain.com/c/Integratori-Aminoacidi/ 我试过这个没成功 location ~ ^/c/(.+)/(.+)\.html { rewrite ^ http://www.domain.com/$1/; } 谢谢
这些是我的NGINX进程: root@ip-192-168-0-12:/etc/nginx/sites-enabled# ps aux | grep nginx root 4758 0.0 0.0 102208 2780 ? Ss Jul25 0:00 nginx: master process /usr/sbin/nginx www-data 5585 0.0 0.0 105868 7048 ? S Jul26 18:12 nginx: worker process www-data 5586 0.0 0.0 105868 6972 ? S Jul26 18:07 nginx: worker process www-data 5587 0.0 0.0 102208 2444 ? S […]
我有一个与我的Nginxconfiguration原型有点问题 情景如下:网站访问者将访问example.com。 Nginx使用GeoIP读取当前位置,并从浏览器接受语言头文件。 这个信息一定是指代理通行证 我的问题是,如何告诉Nginx使用这两个variables的代理通行证。 有了这个configuration,我变成了404错误。 任何想法? geoip_country /usr/share/GeoIP/GeoIP.dat; geoip_proxy 10.241.16.0/24; upstream hybrisqa { server qa-hybris.local:9001; } server { listen 80 default_server; listen [::]:80 default_server; # root /var/www/html; allow all; access_log /var/log/nginx/test_access.log; error_log /var/log/nginx/test.error.log; # Add index.php to the list if you are using PHP # index index.html index.htm index.nginx-debian.html; server_name _; # return 301 […]
我有一个服务运行在一些随机域名(让我们说example.com ),我想从我的本地机器(又名localhost )做一个简单的外观。 location /some-app { # This is for LDAP auth, not sure if important auth_ldap_servers ldapserver; proxy_pass http://example.com; } 我确定它会将我的请求redirect到example.com页面,但是它不会从example.com索引中获取链接的文件,如CSS和JavaScript文件。 我得到像这样的东西: 172.17.0.1 – [email protected] [11/Aug/2016:10:20:35 +0000] "GET /components/navbar/navbar.controller.js HTTP/1.1" 404 570 "http://localhost:8080/some-app" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36" 我曾尝试玩proxy_set_header Host $host; ,但似乎没有任何区别。 我很确定我错过了一些显而易见的东西,但是我不知道是什么。 我已经看到了rewrite规则,但我认为这可能比这更容易。 worker_processes 1; events { worker_connections […]
我正尝试将HTTPauthentication应用到我的大部分网站,除了首页,path/welcome和separate / admin /,/ services /和/ stats / sections。 我似乎没有做到这一点, 这是我目前的configuration: location ~ ^/(admin|services|stats)/ { # L1 # don't need http auth at this path as there is separate auth proxy_pass http://myapp-admin-cluster; 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; proxy_set_header X-Forwarded-Host $server_name; } location / { #L2 location ~ /(?!welcome).+ { […]
我试图写一个nginx.conf将redirect到端口3001 meteor.jstesting环境是我的EC2实例。 如果用户键入“xxx.xxxx.com/test”。 redirect不工作,它从我的meteor.js应用程序search页面。 Nginx和meteor.js应用程序在meteor.js容器中。 nginx.conf: events{ } http{} server { listen *:80; server_name xxxxx.xxxx.com www.xxxxx.xxxx.com; location / { proxy_pass http://xxxxx.xxxx.com:3000; proxy_set_header X-Real-IP $remote_addr; proxy_set_header Host $http_host; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; } location /test/ { proxy_pass http://xxxxx.xxxx.com:3001; proxy_set_header X-Real-IP $remote_addr; proxy_set_header Host $http_host; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; } } } 如何做一个适当的redirect(我对nginx很新)。 先谢谢你!