我有一个静态IP和2个域名(beryju.org和nope.berlin)在我的VPS的nginx设置。 我想服务: 网站1到beryju.org 网站2到blog.beryju.org 站点3到i.beryju.org 站点4到nope.berlin 另外我想要beryju.org和blog.beryju.org支持SSL。 但是用我目前的configuration,我得到: 网站1没有 网站2在beryju.org和blog.beryju.org上 i.beryju.org网站3 网站4 nope.berlin 我试过了,当我从listen语句中删除主机名时也不起作用 listen i.beryju.org:80; 至 listen 80; 在每个文件中。 beryjuorg-blog.conf server { listen blog.beryju.org:80; listen blog.beryju.org:443 ssl; ssl_certificate /home/beryju/SSL/nginx/beryju.org.cert; ssl_certificate_key /home/beryju/SSL/nginx/beryju.org.key; access_log /var/log/nginx/beryjuorg-blog.access.log; error_log /var/log/nginx/beryjuorg-blog.error.log; root /home/beryju/Apps/Ghost/; index index.html index.htm index.php; location / { proxy_pass http://127.0.0.1:2368; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For […]
我有一个Ubuntu 12.04机器上运行的nginx 1.4.3。 我有nginx设置caching页面(他们是数据库驱动,但保持相当静态)。 我正在使用MySQL和PHP-FPM。 但是,我发现我会间歇性地获取空白页面caching。 没有任何错误,只要从/var/cache/nginx删除相应的文件,页面就会回来。 经过一番调查,我发现问题是,如果收到一个HEAD请求,nginxcaching一个空的响应作为该URL的完整响应。 所以HEAD /example在/example页面的caching文件中存储一个空白文件,后续的GET /example返回一个空白页面。 (我似乎经常从各种search引擎和机器人获得HEAD请求。) 这里是相关的网站configuration: location ~ \.php$ { try_files $uri =404; fastcgi_cache one; fastcgi_cache_key $scheme$host$request_uri; fastcgi_cache_valid 200 5m; fastcgi_cache_valid 301 302 304 12h; include /etc/nginx/fastcgi_params; fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME /srv/www/mysite/public$fastcgi_script_name; fastcgi_param HTTPS off; } 这是一个在Nginx中的已知错误? 通过各种search,我还没有find任何有关这方面的信息。 有没有解决方法? 根据这个,无法防止cachingHEAD请求。 我想也许有一些'请求方法'variables可以添加到fastcgi_cache_key ,以便HEAD和GET请求分开caching。 但我什么都找不到
我正在设置一个带有4个vCPU的VPS,它将运行一个网站。 大多数地方build议将nginx的worker_processesconfiguration设置为cpus的数量,所以在这种情况下是4。 服务器也将运行一些其他服务(主要是mysql,memcached),这些服务将被网站使用。 在当前的情况下,是否仍然build议将worker_processes设置为4,或者将其限制为3的好处? 编辑:也运行PHP,通过PHP的FPM – 不知道我怎么不认为这是相关的
在这期间,我的提供者不得不强制重启服务器(拔掉插头),启动后,MySQL服务器出现问题(我正在使用MariaDB)。 经过几个小时的研究,我找不到问题的主要来源或任何解决方法。 该网站相当庞大,涉及比特币,可能会损失数千美元的账户余额(不是真的失去了,只是没有与他们各自的所有者的联系),我很恐慌。 不知何故,文件夹/ var / lib / mysql'转换'成一个同名的文件mysql,它包含乱码: http : //pastebin.com/XbY5YLpG 我也查看了MariaDB的日志文件,在这些文件中有几GB的查询。 有没有任何可能的方式,我可以检索数据库? 我很沮丧
在Nginx服务器上使用Magento运行多重设置。 我正在看访问日志,可以清楚地看到发生了什么。 像许多PHPnetworking应用程序一样,它在它的URL中使用了index.php,并且设置为从可见的URL中“隐藏”它来保持它的清洁。 shoes.com/正在返回shoes.com/index.php shoes.com/sneakers正在返回shoes.com/sneakers/index.php 但是,如果我试图进一步,我看到Nginx不包括index.php的子目录,因为它是根目录。 注意:Magento基本上需要一个修改后的index.php来存放在子目录中的多重分区。 结帐示例: shoes.com/checkout/cart/返回shoes.com/index.php/checkout/cart/ 而在多目录目录中: shoes.com/sneakers/checkout/cart/正在返回shoes.com/sneakers/checkout/cart/,当它应该返回shoes.com/sneakers/index.php/checkout/cart/ 我想弄清楚如何让它适用于这个子目录index.php规则。 我有3个独立的文件我的Nginxconfiguration; 这是重写文件: rewrite_log on; location / { index index.php index.html; try_files $uri $uri/ @handler; } location @handler { rewrite / /index.php; } ## force www in the URL if ($host !~* ^www\.) { #rewrite / $scheme://www.$host$request_uri permanent; } ## Forward paths like /js/index.php/x.js […]
我使用一个nginxnetworking服务器,我一直试图阻止一个问题,其中网站被赋予错误的$_SERVER["PHP_SELF"]variables。 这打破了一些脚本。 问题似乎是nginx给FPM提供了错误的variables。 $_SERVER["PHP_SELF"]是“/index.php/index.php”,它应该是“/index.php” 这是nginx服务器的PHPconfiguration… server { listen 192.168.0.3:80; server_name cacti; access_log /home/admin/cacti_access_log; error_log /home/admin/cacti_error_log; root /var/www/sites/cacti; location / { index index.php index.html index.htm; } location ~* \.php$ { fastcgi_pass unix:/var/run/php-fpm/admin-socket; fastcgi_split_path_info ^(.+\.php)(/.*)$; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_param PATH_INFO $fastcgi_script_name; fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info; include fastcgi_params; fastcgi_read_timeout 60; } } fastcgi_params … fastcgi_param QUERY_STRING $query_string; fastcgi_param REQUEST_METHOD […]
如何将smtp端口从一个ip的25端口redirect到另一个外部mail.domain.com上的端口2525? 例如:我的ip为xxx.xx.xx.xxx,侦听端口为25,用于smtp,现在我想将此端口上的请求转发或redirect到域mx1.somefreehosting.com上的端口2525。 是否有可能使用像networking服务器的nginx呢,还是我需要使用iptables? 我想确保群发邮件或垃圾邮件被照顾。 我提到这个问题 ,但没有评论,因为我的名誉点较less。 动机是在我的诺基亚Lumia上设置电子邮件帐户,该帐户没有通过smtp发送电子邮件(可能是由于端口)。 编辑:(请参阅评论与尼尔斯)我想创build一个中间机器,简单地转发到某些外部MTA的SMTP连接。 我不是专家,所以可能无法写出技术上正确的话。 我的vps将监听myip:25并将其redirect到外部IP:2525。 不知道它有多可行吗?
我有一个技术部门的服务器(具有root访问权)在一些子域上运行一个web应用程序应用程序。 但该应用程序需要validation。 所以我请求了域的SSL密钥。 技术小组不愿意给我钥匙 – 这是可以理解的。 我需要不时地重新启动服务器。 是否可以为非root用户configuration权限,以便能够重新启动服务器,但无法访问其SSL密钥? 服务器可能是apache或nginx。 如果我运行两个没有root权限的任何一个,我得到以下内容: 阿帕奇: AH00526: Syntax error on line 35 of /etc/apache2/sites-enabled/canvas-misis-ru.conf: SSLCertificateKeyFile: file '/etc/ssl/private/ssl-cert-snakeoil.key' does not exist or is empty nginx的: nginx: [alert] could not open error log file: open() "/var/log/nginx/error.log" failed (13: Permission denied) 2014/09/21 17:08:55 [warn] 16805#0: the "user" directive makes sense only if the […]
我在Mac OS X上,在VirtualBox中运行Ubuntu。 Mac OS可以在IP 192.168.0.100和Ubuntu 192.168.0.123(使用VirtualBoxnetworking设置中的“桥接适配器”选项)的本地networking中访问。 在Ubuntu安装中,我有nginx(端口80)作为Apache 2.4(端口8081)的反向代理。 这工作正常,如果我在Mac OS中打开浏览器并指向192.168.0.123,它将通过nginx打开Apache提供的文件。 问题是,即使我已经启用了RPAF模块,我在Apache上获得了服务器和远程IP地址的意外值。 从Mac浏览器访问时,我期望的值是: SERVER_ADDR = 192.168.0.123 # Apache server IP, which is the Ubuntu IP REMOTE_ADDR = 192.168.0.100 # The Mac OS X IP 但是,如果我将nginx设置为proxy_pass 192.168.0.123:8081我会得到: SERVER_ADDR = 192.168.0.123 REMOTE_ADDR = 198.168.0.123 设置proxy_pass 127.0.0.1:8081给我正确的远程地址(191.168.0.100),但127.0.0.1作为服务器地址。 任何想法如何获得预期的结果? ( 编辑 )我使用默认的RPAF设置: <IfModule rpaf_module> RPAF_Enable On RPAF_ProxyIPs 127.0.0.1 RPAF_SetHostName […]
我知道这个问题已经被问及答复了一百万次,但是没有一个被接受的答案正在为我工作。 当我强制所有连接到https时,由于某种无限的redirect循环,我的网站无法访问。 root /usr/share/nginx/html/flawedspirit.com/root_html; index index.php index.html index.htm; error_page 403 /index.php; error_page 404 /error/404.php; error_page 500 502 503 504 /error/50X.php; access_log /usr/share/nginx/html/flawedspirit.com/logs/access.log; error_log /usr/share/nginx/html/flawedspirit.com/logs/error.log; server { listen 80 default_server; server_name flawedspirit.com; return 301 https://$server_name$request_uri; location ~ \.php { try_files $uri $uri/ =404; include fastcgi_params; fastcgi_pass php5-fpm-sock; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_intercept_errors on; } location ~ /\. […]