我更新nginx到1.4.7和PHP到5.5.12 ,之后,我得到了502错误 。 在我更新之前一切工作正常。 nginx的-error.log中 2014/05/03 13:27:41 [crit] 4202#0: *1 connect() to unix:/var/run/php5-fpm.sock failed (13: Permission denied) while connecting to upstream, client: xx.xxx.xx.xx, server: localhost, request: "GET / HTTP/1.1", upstream: "fastcgi://unix:/var/run/php5-fpm.sock:", host: "xx.xx.xx.xx" nginx.conf user www www; worker_processes 1; location / { root /usr/home/user/public_html; index index.php index.html index.htm; } location ~ [^/]\.php(/|$) { fastcgi_split_path_info ^(.+?\.php)(/.*)$; […]
在Nginx中,variables$host和$http_host什么区别。
我正在运行Django,FastCGI和Nginx。 我正在创build一个类似的api,在那里有人可以通过XML发送一些数据,我将处理,然后返回每个节点发送的状态码。 问题是,如果我花了很长时间来处理XML,Nginx会抛出一个504网关超时 – 我想超过60秒。 所以我想设置Nginx,以便如果任何匹配location / api的请求不会超时120秒。 什么设置将完成。 我到目前为止是: # Handles all api calls location ^~ /api/ { proxy_read_timeout 120; proxy_connect_timeout 120; fastcgi_pass 127.0.0.1:8080; } 编辑:我有什么不工作:)
我有一个Ruby / Sinatra应用程序运行nginx,一切都很好。 但是,我现在试图从同一台服务器运行第二个应用程序,我注意到一些奇怪的东西。 首先,这是我的nginx.conf: pid /tmp/nginx.pid; error_log /tmp/nginx.error.log; events { worker_connections 1024; accept_mutex off; } http { default_type application/octet-stream; access_log /tmp/nginx.access.log combined; sendfile on; tcp_nopush on; tcp_nodelay off; gzip on; gzip_http_version 1.0; gzip_proxied any; gzip_min_length 500; gzip_disable "MSIE [1-6]\."; gzip_types text/plain text/xml text/css text/comma-separated-values text/javascript application/x-javascript application/atom+xml; upstream app { server unix:/var/www/app/tmp/sockets/unicorn.sock fail_timeout=0; } […]
我在amazon linux上的https://uwsgi.readthedocs.org/en/latest/Upstart.html教程中创build了一个uwsgi文件。 虽然Nginx似乎没有运行,只是说坏的网关。 如果我运行 /etc/init/uwsgi.conf description "uwsgi tiny instance" start on runlevel [2345] stop on runlevel [06] exec /home/ec2-user/venv/bin/uwsgi –ini /home/ec2-user/uwsgi-prod_demo.ini 如果我在shell中运行以下代码,则python应用程序将运行。 /home/ec2-user/venv/bin/uwsgi –ini /home/ec2-user/uwsgi-prod_demo.ini uwsgi-prod_demo.ini [uwsgi] socket = :8080 chdir = /home/ec2-user/prod_demo master = True venv = /home/ec2-user/venv callable = app wsgi-file = /home/ec2-user/prod_demo/manage.py enable-threads = True https = =0,/home/ec2-user/xxx.com.au.pem,/home/ec2-user/newkey.pem,HIGH nginx.conf user ec2-user; worker_processes […]
我使用nginx作为前台服务器,我修改了CSS文件,但是nginx仍旧在服务于旧的服务器。 我试图重新启动nginx,没有成功,我已经谷歌search,但没有find一个有效的方法来清除它。 一些文章说,我们可以删除caching目录: var/cache/nginx ,但在我的服务器上没有这样的目录。 我现在应该怎么做?
我正在用nginx和gunicornconfigurationdjango项目。 当我访问我的端口gunicorn mysite.wsgi:application –bind=127.0.0.1:8001在nginx服务器我在我的错误日志文件中得到以下错误。 2014/05/30 11:59:42 [crit] 4075#0: *6 connect() to 127.0.0.1:8001 failed (13: Permission denied) while connecting to upstream, client: 127.0.0.1, server: localhost, request: "GET / HTTP/1.1", upstream: "http://127.0.0.1:8001/", host: "localhost:8080" 我的nginx.conf文件 server { listen 8080; server_name localhost; access_log /var/log/nginx/example.log; error_log /var/log/nginx/example.error.log; location / { proxy_pass http://127.0.0.1:8001; proxy_set_header X-Forwarded-For $remote_addr; proxy_set_header Host $http_host; } […]
我的meteor应用程序的网站configuration有如下的指令: server { listen 443; server_name XXX; ssl on; ssl_certificate XXX; ssl_certificate_key XXX; location / { proxy_pass http://localhost:3000; proxy_set_header X-Real-IP $remote_addr; # http://wiki.nginx.org/HttpProxyModule proxy_http_version 1.1; # recommended for keep-alive connections per http://nginx.org/en/docs/http/ngx_http_proxy_module.html#proxy_http_version proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade"; proxy_set_header Host $host; } } 我觉得我应该告诉nginx服务static_cacheable内容,并设置expires标题为max 。 我到底怎么做呢? 我还有其他的东西吗?
我有这个错误请求。 德语的最后一句话的意思是“Firefox无法连接到位于ws:// …….”的服务器。 服务器不会是我想的问题。 因为这里是nginx的configuration,因为我觉得有问题! server { server_name example.org; listen 80 default_server; root /var/www/web; location / # for symfony2 { try_files $uri @rewriteapp; } location @rewriteapp # for symfony2 { rewrite ^(.*)$ /app.php/$1 last; } location ~ ^/app\.php(/|$) { fastcgi_pass unix:/var/run/php5-fpm.sock; fastcgi_split_path_info ^(.+\.php)(/.*)$; include fastcgi_params; fastcgi_param HTTPS off; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; } location ~ ^/socket […]
我用uWSGI和nginx运行我的Flask应用程序。 有500错误,但追溯不会出现在浏览器或日志中。 如何从Flasklogging回溯? uwsgi –http-socket 127.0.0.1:9000 –wsgi-file /var/webapps/magicws/service.py –module service:app –uid www-data –gid www-data –logto /var/log/magicws/magicapp.log uWSGI日志只显示500状态码,而不是回溯。 在nginx日志中也没有任何东西。 [pid: 18343|app: 0|req: 1/1] 127.0.0.1 () {34 vars in 642 bytes} [Tue Sep 22 15:50:52 2015] GET /getinfo?color=White => generated 291 bytes in 64 msecs (HTTP/1.0 500) 2 headers in 84 bytes (1 switches on core 0)