我有我的networking应用程序与AppCache合作,我希望当我修改我的HTML / CSS / JS文件,然后更新我的caching清单,当用户访问我的Web应用程序,他们将有一个更新版本的这些文件。 如果我更改了一个HTML文件,它完美的工作,但是当我更改CSS和JS文件时,旧版本仍在使用中。 我一直在检查一切,我认为这与我的nginxconfiguration有关。 我有一个cache.conf文件,其中包含以下内容: gzip on; gzip_types text/css application/x-javascript text/x-component text/richtext image/svg+xml text/plain text/xsd text/xsl text/xml image/x-icon; location ~ \.(css|js|htc)$ { expires 31536000s; add_header Pragma "public"; add_header Cache-Control "max-age=31536000, public, must-revalidate, proxy-revalidate"; } location ~ \.(html|htm|rtf|rtx|svg|svgz|txt|xsd|xsl|xml)$ { expires 3600s; add_header Pragma "public"; add_header Cache-Control "max-age=3600, public, must-revalidate, proxy-revalidate"; } 而在default.conf中我有我的位置。 我想这个caching在除了一个地方的所有位置上工作,我怎么能configuration这个? […]
我有一个子域,something.site.com。 在我的主网站site.com/something,我想重写something.site.com,但保持urlsite.com/something完好无损。 那我能用nginx重写规则做些什么?
我正在尝试为Zimbra编写一个重写规则,这将允许我使用主机名来访问Zimbra桌面Web UI,而不是IP地址和端口。 默认的Zimbraurl如下所示: http://127.0.0.1:port/?at=long-encrypted-user-id http://127.0.0.1:port/zimbra/?at=long-encrypted-user-id http://127.0.0.1:port/desktop/login.jsp?at=long-encrypted-user-id 这是我到现在为止: server { server_name hostname; location / { 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_pass http://127.0.0.1:port/; } } 这只会在后台用http://127.0.0.1:portreplacehttp://hostname ; 我卡住的地方是将?at=long-encrypted-user-id到URL中。 有人可以帮忙吗?
我正在尝试为WordPress的博客做反向代理caching,我碰到了一些麻烦。 初始configuration是这样一个简单的反向caching location / { proxy_cache_key "$scheme://$host$request_uri"; proxy_cache staticfilecache; proxy_pass http://wordpressapache; add_header Cache-Control public; proxy_cache_valid 200 302 10d; 我很快意识到,login的用户将被发送与折腾,所以我做了 proxy_set_header X-Real-IP $remote_addr; proxy_set_header Host $host; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header Accept-Encoding ""; location / { # If logged in, don't cache. if ($http_cookie ~* "comment_author_|wordpress_(?!test_cookie)|wp-postpass_" ) { set $do_not_cache 1; } proxy_cache_key "$scheme://$host$request_uri $do_not_cache"; proxy_cache staticfilecache; […]
我已经将Nginx设置为Node的反向代理,并提供我的静态文件和用户上传的图像。 除了我不明白为什么Nginx无法find我的.zip文件,一切都运行得非常好。 这是我的nginx.conf。 user nginx; worker_processes 1; error_log /var/log/nginx/error.log warn; pid /var/run/nginx.pid; events { worker_connections 1024; } http { include mime.types; proxy_cache_path /var/www/web_cache levels=1:2 keys_zone=ooparoopaweb_cache:8m max_size=1000m inactive=600m; sendfile on; upstream *******_node { server 172.27.198.66:8888 max_fails=3 fail_timeout=20s; #fair weight_mode=idle no_rr } upstream ******_json_node { server 172.27.176.57:3300 max_fails=3 fail_timeout=20s; } server { #REDIRECT ALL HTTP REQUESTS FOR […]
我正在使用Nginx和ISPConfig 3进行configuration,我得到重写或内部redirect周期,我无法用我有限的nginx的知识弄清楚。 [error] 13741#0: *64 rewrite or internal redirection cycle while internally redirecting to "/index.html", client: 127.0.0.1, server: localhost, request: "GET / HTTP/1.1", host: "localhost" 虚拟主机configuration: server { listen 8080 ssl; ssl_certificate /usr/local/ispconfig/interface/ssl/ispserver.crt; ssl_certificate_key /usr/local/ispconfig/interface/ssl/ispserver.key; server_name _; root /usr/local/ispconfig/interface/web/; client_max_body_size 20M; location / { index index.php index.html; } # serve static files directly location ~* […]
可能重复: 使用Magento进行4个或更多的并发请求时,100%的CPU 人。 这是我的第一个问题,但这个社区已经帮了我好几百次了,非常感谢。 现在到我的问题。 我知道类似的问题已经多次发布,但在Google和shell几个小时之后,我仍然无法解决问题。 这是在一台运行Ubuntu 12.04的networking服务器上安装了Magento,stream量很低(每周约70K页面浏览量)。 服务器规格: Ubuntu 12.04 1个核心 2 GB RAM 软件版本 Nginx:1.1.19 PHP5-FPM:5.3.10-1ubuntu3.4(fpm-fcgi) MySQL:5.5.28-0ubuntu0.12.04.2 APC:3.1.7 Memcached:1.4.13 据我所知,APC和Memcached是完美的。 当服务器正在处理时,产生以下输出10 – 10 – 用户 (基本上什么也没有) 最佳 top – 14:07:41 up 12 days, 3:45, 1 user, load average: 1.37, 1.43, 1.48 Tasks: 90 total, 6 running, 84 sleeping, 0 stopped, 0 zombie Cpu(s): […]
我已经设置了一个网站的代理,它与以下nginxconfiguration一起工作: server { listen 80; server_name proxy.example.com; access_log /dev/null; error_log /dev/null; location / { proxy_pass http://thepiratebay.se; proxy_set_header X-Real-IP $remote_addr; } } 然而,在这个也有从一个子域( static.thepiratebay.se )加载的样式,这是不经过我的代理,因为它链接到原来的域名。 有没有办法让这些请求去我的代理? 服务时是否必须更改页面的内容,让他们也通过我的代理? 如果是的话:怎么样? :)还是有另一种(也许更好)的方式?
这里是我的nginx(1.1.19)conf为Silverstripe网站。 我也在使用PHP-FPM。 nginx和PHP-FPM大部分是目前的香草设置。 我正在使用一个单独的FPM池与自己的Unixsockets。 server { server_name dev.example.com; root /srv/www/example.com/dev; index index.php index.html; access_log logs/dev.example.com.access.log; error_log logs/dev.example.com.error.log; location ~* ^.+\.(css|js|jpg|jpeg|gif|png|ico|gz|svg|svgz|ttf|otf|woff|eot|mp4|ogg|ogv|webm)$ { expires 7d; access_log off; access_log off; log_not_found off; } error_page 404 /framework/main.php; location / { try_files $uri @silverstripe; } location @silverstripe { include fastcgi_params; fastcgi_param SCRIPT_FILENAME $document_root/framework/main.php; fastcgi_param SCRIPT_NAME /framework/main.php; fastcgi_param QUERY_STRING url=$uri&$args; fastcgi_buffer_size […]
如果用户使用IE8直接访问www.xyz.com,那么SSL证书就可以。 直接进入www.zyx.com的用户没有证书问题。 如果用户从一个站点开始并转到另一个站点,那么他们会得到无效的证书,而xyz正在zyx上使用,而这种情况不应该发生。 阅读论坛NGINX启用了SNI,我拥有正确版本的OpenSSL能够处理多个证书。 IE8似乎是问题,但这些是面向客户的网站。 有没有一个修复,使NGINX的客户遇到问题。