我们在逆向代理模式下的Apache服务器前面有nginx。 我们最初使用mod_deflate压缩文件,但是这certificate会导致一些Internet Explorer实例的问题。 我的猜测是,有一些奇怪的处理“不同”的反应,由nginx和它的代理caching触发IE问题。 我们现在试图使用nginx自己来压缩内容,所以我们在Apache中禁用了mod_deflate,并将以下内容添加到nginx服务器configuration gzip on; gzip_proxied any; gzip_types text/css text/plain text/xml application/xml application/javascript application/x-javascript text/javascript application/json text/x-json; gzip_vary on; gzip_disable "MSIE [1-6]\."; 这没有效果。 内容总是在不使用gzip压缩的情况下提供,使用Fiddler进行validation。 我已经尝试过的事情: 删除gzip_vary和gzip_disable选项(后者被本网站上的其他一些问题牵连)。 移动gzip 设置到服务器{}设置的位置{}部分。 在location {}之前和之后移动gzip设置 有没有人有这种设置工作? 操作系统:CentOS 2.6.18-274.17.1.el5,nginx版本:1.0.12
当〜+ 10K连接(netstat -an | grep 80 | wc -l)时,我经常在随机页面上出现这个错误。 发生这种情况时,仍有+ 10GB的可用内存,服务器负载小于3。 我的相关configuration: /etc/php5/fpm/php.ini memory_limit = 1024M default_socket_timeout = 120 /etc/php5/fpm/pool.d/www.conf pm = dynamic pm.max_children = 30 pm.start_servers = 5 pm.min_spare_servers = 2 pm.max_spare_servers = 5 ;pm.max_requests =20000 #uncommented with any value didn't fixed request_terminate_timeout = 120s 我还把上述的一些线索(即60个孩子,10个开始,10个最大的服务器)翻了一番,没有用。 /etc/nginx/nginx.conf worker_connections 4024; keepalive_timeout 10; 支持Varnish和memcached的Nginx本身是启用的。 一般页面渲染速度相当快。 这似乎是一个很常见的问题,我找不到任何有用的解决scheme,甚至分析可能的原因。 […]
我有单声道2.11与我的nginx 1.0.15 web服务器运行在centos 6.2上设置。 我从源代码构build,xps2,xps4和fastcgi-mono-server2按预期工作。 问题是当我尝试运行fastcgi-mono-server4时。 当我运行: fastcgi-mono-server4 /applications=site:/:/srv/www/html/ /socket=tcp:127.0.0.1:9000 /loglevels=Debug /printlog=true 这是我从fastcgi-mono-server2得到的: [2012-06-06 23:51:07Z] Debug Record received. (Type: BeginRequest, ID: 1, Length: 8) [2012-06-06 23:51:07Z] Debug Record received. (Type: Params, ID: 1, Length: 801) [2012-06-06 23:51:07Z] Debug Record received. (Type: Params, ID: 1, Length: 0) [2012-06-06 23:51:07Z] Debug Read parameter. (QUERY_STRING = ) [2012-06-06 […]
我正在尝试configurationphpMyAdmin,所以我在Nginx中设置了stream动位置,但它将“pma”添加到根目录中: 2012/08/14 13:59:49 [error] 10151#0: *2 "/usr/share/phpMyAdmin/pma/index.php" is not found (2: No such file or directory), client: 192.168.1.2, server: domain.com, request: "GET /pma/ HTTP/1.1", host: "192.168.1.24" configuration: location ^~ /pma { root /usr/share/phpMyAdmin; location ~ \.php$ { root /usr/share/phpMyAdmin; fastcgi_pass unix:/var/run/php-fpm/www.sock; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; include fastcgi_params; fastcgi_param HTTPS on; } ## HTTP to […]
我在我的静态内容以及Last-Modified标题上添加了X-Accel-Expires标题。 我想知道什么是正确的设置来caching这些元素而不caching其他任何东西。 这是我目前所拥有的,但不会caching任何内容: http { include /etc/nginx/mime.types; access_log /var/log/nginx/access.log; sendfile on; client_max_body_size 2000m; keepalive_timeout 65; tcp_nodelay on; gzip on; gzip_disable "MSIE [1-6]\.(?!.*SV1)"; include /etc/nginx/conf.d/*.conf; include /etc/nginx/sites-enabled/*; ssl_certificate /etc/nginx/chain.pem; ssl_certificate_key /etc/nginx/key.key; proxy_cache_path /var/lib/nginx/cache levels=1:2 keys_zone=cache:30m max_size=1G; proxy_temp_path /var/lib/nginx/proxy 1 2; proxy_cache_use_stale error timeout invalid_header http_502; server { listen 80; server_name domain; location / { proxy_pass http://127.0.0.1:8080; […]
我试图理解nginx更好一点,并试graphics成一个正则expression式,其中每个不匹配/ api / postdataV1的url被路由到不同的服务器集群。 我用例子来看这两个东西,没有任何解释 location ~ {some regex} location ~* (some regex} 我的第一个问题是这些〜和〜*(我认为〜只意味着我指定了一个正则expression式?),那么〜*呢? 我想我想要的是这个。 这是正确的吗? location ~ ^/api/postdataV1$ { #matches to this route to where I want } location / { #This will be everything except /api/postdataV1 I think } 这是正确的吗? 但是那个〜* …我没有得到那个 谢谢,Dean
我试图重新加载nginx,我有一个域名的通配符证书,我从namecheap,现在我已经把它移动到我的服务器,并分配一个nginxconfiguration规则: ssl_certificate /etc/nginx/certs/website.com.crt; ssl_certificate_key /etc/nginx/certs/website.com.key; ssl_ciphers ECDHE-RSA-AES128-SHA256:AES128-GCM-SHA256:RC4:HIGH:!aNULL:!MD5:!EDH; add_header Strict-Transport-Security max-age=15768000; ssl_session_cache shared:SSL:10m; 现在当我通过service nginx reload加载nginx时,我不断收到提示: 重新加载nginxconfiguration:inputPEM密码短语: 不幸的是,我不知道PEM密码短语,但是当我使用OpenSSL生成CSR时,我确实有密码短语,但是这不符合PEM密码短语。 我不知道我能做什么,我怎样才能恢复这个,或能够删除它(如果它不影响安全) 我正在运行Ubuntu 12.04.1 LTS和nginx 1.2.6。
我使用这个configuration在Nginx上运行Magento: http : //www.magentocommerce.com/wiki/1_-_installation_and_configuration/configuring_nginx_for_magento 。 现在我想301所有的url都没有跟踪斜线到包含斜线的对方。 例如:/ contacts to / contacts /。 我试过几乎所有的nginx指令,我都能find,但无济于事。 例如,在nginx中指定的指令 – 使用拖尾斜杠重写URL会导致redirect到/index.php/。 我应该添加哪个指令?
我正在尝试将我的网站的域名从https://www.myolddomain.se/更改为https://www.mynewdomain.se/ 问题是,我的旧域强制所有页面上的SSL,因此谷歌和其他网站上的所有链接都与https链接。 当我尝试从https链接访问旧域时,出现证书错误。 所以我的问题是:我怎样才能redirect链接到HTTPS的另一个HTTPS安全域,在Nginx,没有得到这个错误? 我做了一些研究,发现这个redirect网页的解决scheme,现在插入到我的configuration文件中。 虽然我仍然得到证书错误! server { server_name .myolddomain.se; return 301 https://www.mynewdomain.se$request_uri; } 但是我无法完成它的工作! 如果有人能拿出答案,我将非常感激
我试图从PHP Web应用程序连接到PostgreSQL Unix域套接字。 相关系统组件: CentOS 7 x64(强制执行SELinux) postgresql93 9.3.5-2PGDG.rhel7 nginx 1.6.2-1.el7.ngx php-common 5.4.16-23.el7_0.3 php-fpm 5.4.16-23.el7_0.3 php-pdo 5.4.16-23.el7_0.3 php-pgsql 5.4.16-23.el7_0.3 PostgreSQL正在监听标准端口5432,我没有问题通过TCP / IP在127.0.0.1:5432,但是当我尝试连接到它的Unix域套接字,我有一个以下错误: Cannot connect to database: SQLSTATE[08006] [7] could not connect to server: No such file or directory Is the server running locally and accepting connections on Unix domain socket "/tmp/.s.PGSQL.5432"? 文件/tmp/.s.PGSQL.5432存在,我可以连接使用psql : $ psql […]