是否存在一个轻量级的(当我尝试Apache的时候吃了几百兆内存)反向HTTP代理,它支持WebSockets? 我到目前为止使用英镑不支持websockets,但现在我想添加一个需要websockets工作的后端。 我考虑了我目前在所有后端使用的nginx,并提供webproxy支持。 不幸的是,似乎没有办法通过nginx来禁止http请求的缓冲。 所以file upload永远不会“stream”到后端,而是先被nginxcaching。 我不需要负载平衡或caching和SSL终止只是一个很好的。 哪个http反向代理给我websocket支持以及http请求的“stream”?
我想让nginx直接login到piwik。 我有问题得到rsyslog来接受一些syslog ng语法。 rsyslog文件说syslog-ng conf是兼容的。 source s_nginx_20 { pipe("/var/lib/nginx/access.log" program_override("nginx-access-log")); }; filter f_nginx_20 { match("nginx-access-log" value("PROGRAM")); }; destination d_piwik { program("/path/to/piwik.sh" template("$MSG\n")); }; log { source(s_nginx_20); filter(f_nginx_20); destination(d_piwik); }; 以上结果是: Mar 3 02:05:21 CentOS-65-64-minimal kernel: imklog 5.8.10, log source = /proc/kmsg started. Mar 3 02:05:21 CentOS-65-64-minimal rsyslogd: [origin software="rsyslogd" swVersion="5.8.10" x-pid="24662" x-info="http://www.rsyslog.com"] start Mar 3 […]
我正在试图让uwsgi与nginx结合使用来作为烧瓶应用程序。 这是UWSGI ini文件: [uwsgi] socket = 127.0.0.1:8001 processes = 4 module = run:manager virtualenv = /var/www/test/venv chdir = /var/www/test logto = uwsgi.log 在目录/ var / www / test中我有这个文件run.py from flask.ext.migrate import Migrate, MigrateCommand from flask.ext.script import Manager from app import app, db if __name__ == "__main__": migrate = Migrate(app, db) manager = Manager(app) manager.add_command('db', MigrateCommand) […]
我最近为Web开发客户端configuration了一个新的服务器,并遇到了一个有趣的问题。 该网站的stream量相当高,但CMS在实时生成页面时相当繁重且效率低下。 当需要直接从CMS生成页面时,这会显着降低页面加载速度。 不幸的是CMS与Apache有许多关系,所以通过nginx提供页面并不是一个可行的select。 另外,CMS的Apache .htaccess文件必然有些复杂且涉及到,因此Apache提供的请求相对较慢。 由于这些因素,我将nginxconfiguration为反向代理服务器,并为CMS编写了一个插件,将页面呈现为静态HTML,并将其存储在特定的caching目录中。 我的意图是configurationnginx直接提供caching文件的请求,从而完全避免apache(更重要的是,避免CMS)。 到目前为止,这个过程已经顺利进行了,我有nginx成功地为CMS生成的caching文件提供服务(与CMS的500 + ms相比,响应时间很短,为25ms),如果caching文件没有传递到CMS存在,除了一个例外:主页。 出于某种原因,主页位置块似乎并没有被激活。 这是网站configuration(匿名): # reverse proxy config for example.com, serves all non-dynamic files server { listen 80; server_name example.com www.example.com; root /var/www/example.com/; add_header "X-Index-0" "block-0"; location ^~ ^(index)?\.?(htm|html|php|asp|aspx)?$ { try_files /var/www/example.com/cache/index.html @apache; add_header "X-Index-1" "block-1"; } location / { try_files /var/www/example.com/cache/index.html @apache; add_header "X-Index-2" "block-2"; […]
我在URL example.com/media/上有一个媒体文件夹,我想拒绝用户在我的服务器上运行脚本。 我的服务器应用程序是nginx和如何拒绝在可写目录中的脚本执行我找不到特定的URL的任何特殊的。 这是我的nginx服务器configuration: # sites-avalaible/default server { listen 80; listen 443 ssl; server_name www.example.com example.com; ssl_certificate /var/www/example/ssl/ssl.crt; ssl_certificate_key /var/www/example/ssl/ssl.key; location /static { alias /var/www/example/static; expires 7d; add_header Pragma public; add_header Cache-Control "public, must-revalidate, proxy-revalidate"; } location /media { alias /var/www/example/media; # limit download speed after 5mb download limit_rate_after 5m; limit_rate 120k; limit_req zone=lh burst=5 […]
我正在Docker容器中设置一个ghost博客实例。 我绑定了虚拟主机服务器0.0.0.0并暴露了它正在监听的端口(端口2368)。 如果我从外部运行wget到ghost容器的ip和ghost的端口,索引被提取,但是如果我使用完全相同的ip和端口在另一个容器内运行wget,wget报告 –2014-03-20 02:58:27– http://172.17.0.5:2368/ Connecting to 172.17.0.5:2368… connected. HTTP request sent, awaiting response… 并无限期地挂起。 我想能够从另一个容器中连接到ghost实例,因为我将使用第二个容器作为nginx的反向代理(我正在使用wget,因为我想testing连接性,因为我用nginx的尝试导致了Gateway超时)。 这是预期的还是幽灵需要额外的configuration服务内容到另一个docker集装箱? 更新 我忘了提到“反向代理是”容器链接到鬼实例容器。
我正在从Apache过渡到Nginx,我试图找出如何让我的子域重写规则工作。 阿帕奇 Apacheconfiguration我已经基本上将所有stream量转移到HTTPS并将.net和.org域更改为主.com域。 我们的一些用户仍然认为每个URL都应该以“www”开头,所以如果还有另一个子域名的话,安装程序会将其删除。 没有任何子域名的url会被redirect到https://www.example.com ,这对于网站的工作并不一定是强制性的。 # HTTP <VirtualHost *:80> RewriteEngine on # Redirect http://example.tld -> https://www.example.com RewriteCond %{SERVER_PORT} !^443$ RewriteCond %{HTTP_HOST} ^example\.(com|net|org) RewriteRule ^(.*)$ https://www.example.com$1 # Redirect http://www.subdomain.example.tld -> https://subdomain.example.com RewriteCond %{SERVER_PORT} !^443$ RewriteCond %{HTTP_HOST} ^www.([^\.]+)\.example\.(com|net|org) RewriteRule ^(.*)$ https://%1.example.com$1 # Redirect http://subdomain.example.tld -> https://subdomain.example.com RewriteCond %{SERVER_PORT} !^443$ RewriteCond %{HTTP_HOST} ^([^\.]+)\.example\.(com|net|org) RewriteRule ^(.*)$ https://%1.example.com$1 [NC,R,L] […]
我的访问日志充满了这样的条目: 178.207.40.219 – – [03/Apr/2014:17:34:37 +0200] "GET http://win.mail.ru/cgi-bin/[email protected]&Domain=mail.ru&Password=241716 HTTP/1.1" 403 168 "-" "Mozilla/5.0 (X11; U; Linux i686; en-GB; rv:1.7.6) Gecko/20050405 Epiphany/1.6.1 (Ubuntu) (Ubuntu package 1.0.2)" "-" 178.207.40.219 – – [03/Apr/2014:17:34:37 +0200] "GET http://win.mail.ru/cgi-bin/[email protected]&Domain=mail.ru&Password=cbvfdghjr HTTP/1.1" 403 570 "-" "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; MathPlayer2.0)" "-" 178.207.40.219 – – [03/Apr/2014:17:34:38 +0200] "GET http://win.mail.ru/cgi-bin/[email protected]&Domain=mail.ru&Password=tata915 HTTP/1.1" 403 […]
我使用守护进程工具与传动员 我在考虑是否应该为Nginxconfiguration守护进程工具 还是自动处理它的closures(如果内存问题等)?
我试图将这个htaccess规则转换为nginx: 阿帕奇 # Necessary to prevent problems when using a controller named "index" and having a root index.php # more here: http://httpd.apache.org/docs/2.2/content-negotiation.html Options -MultiViews # Activates URL rewriting (like myproject.com/controller/action/1/2/3) RewriteEngine On # Disallows others to look directly into /public/ folder Options -Indexes # When using the script within a sub-folder, put this path here, […]