我有一个运行OpenWrt Linux的embedded式设备。 我已经安装和configuration了像OpenWrt Wiki中描述的php5-fastcgi和nginx : https ://wiki.openwrt.org/doc/howto/http.nginx此外,我已经安装了php5-mod-session和php5-mod-sockets 。 似乎一切工作正常的基本文件,如图像,静态HTML页面,以及PHP脚本。 我的网页有一个JS脚本(AJAX),它每秒轮询一个PHP脚本。 大约5到10分钟后,在所有PHP页面上发生502 Bad Gateway错误。 如果我检查我的Linux机器上正在运行的进程,我可以看到,进程php5-fastcgi不再运行。 PHP日志是空的,Nginx的日志只显示到FastCGI服务器的连接错误。 我知道在互联网上有很多这方面的话题,但我还没有find解决scheme。 也许有人可以帮忙! 感谢所有的build议!
(期望)面向用户的url:https // somedomain.com / dir / (实际工作)实际的url:https // somedomain.com:8371 / dir / 我正在尝试从一个漂亮的url创build一个反向代理来加载一个更复杂的看起来更丑陋的url。 返回的url:https // somedomain.com / dir / 然而,没有什么是加载,它返回正确的URL,但它看起来不像代理正在端口8371。 这是我的nginxconfiguration: server { listen 80; server_name somedomain.com; return 301 https://$host$request_uri; } server { listen 443; server_name somedomain.com; ssl_certificate /etc/nginx/ssl/cert.crt; ssl_certificate_key /etc/nginx/ssl/cert.key; ssl on; ssl_protocols TLSv1 TLSv1.1 TLSv1.2; ssl_ciphers HIGH:!aNULL:!eNULL:!EXPORT:!CAMELLIA:!DES:!MD5:!PSK:!RC4; ssl_prefer_server_ciphers on; access_log /var/log/nginx/access.log; location / […]
官方的nginx文档指出,如果你没有用ssl_session_ticket_key指令指定一个会话票据密钥… …使用随机生成的密钥。 它还指出,包含密钥的文件… …必须包含80或48字节的随机数据。 但是文档没有指定nginx自动生成的密钥长度是80还是48个字节。 有人知道吗? Doc: http : //nginx.org/en/docs/http/ngx_http_ssl_module.html#ssl_session_ticket_key
我有一个开发人员试图为我的Nginx服务器创buildSSLconfiguration,但是它仍然不能正常工作。 我想强制/redirect到我的所有子域到HTTP,并且只允许没有子域的主域,使用SSL。 这是我目前的configuration: set $ssl_rule ""; if ($scheme = http) { set $ssl_rule "1"; } if ($scheme = https) { set $ssl_rule "0"; } if ($host = "mystite.com") { set $ssl_rule "${ssl_rule}1"; } if ($host = "www.mysite.com") { set $ssl_rule "${ssl_rule}1"; } if ($host ~ (?!www).+.mysite\.com) { set $ssl_rule "${ssl_rule}0"; } if ($ssl_rule = "11") […]
我想build立一个nginxconfiguration,它会根据外部工具的configuration来代理stream量。 例如,今天我想代理一个对example.com的请求,明天它将是一个IP地址,并在其他地方的第二天。 有什么办法可以让nginx从我可以设置的文件或环境variables中读取。 这似乎是一个黑客更新网站configuration,并强制configuration重新加载(或者是好的?)
目前通过conda venv在Linux服务器上运行烧瓶应用程序。 一切看起来都不错, Nginx和uWSGI正在运行,但是服务器正在返回错误日志中的上游连接错误。 Linux: http : //imgur.com/a/lmNY2 Nginx的: server { listen 80; real_ip_header X-Forwarded-For; set_real_ip_from 127.0.0.1; server_name 127.0.0.1; location / { include uwsgi_params; uwsgi_pass unix:/var/www/html/pricing-service/socket.sock; uwsgi_modifier1 30; } error_page 404 /404.html; location = /404.html { root /usr/share/nginx/html; } error_page 500 502 503 504 /50x.html; location = /50x.html { root /usr/share/nginx/html; } } uWSGI: [uwsgi] […]
我在Ubuntu上运行nginx。 我试图build立一个客户端连接到我的服务器的方式,并允许服务器运行一个脚本,每当客户端失去连接。 我如何监控和采取行动呢?
我使用的是Debian 8,Nginx 1.10,服务器Apache2。 我的Nginxconfiguration是: proxy_cache_path /tmp/nginx levels=1:2 keys_zone=my_zone:10m inactive=60m; proxy_cache_key "$scheme$request_method$host$request_uri"; server { …. location ~* \.(?:jpg|jpeg|gif|png|ico|cur|gz|svg|svgz|mp4|ogg|ogv|webm|htc|css|js)$ { proxy_cache my_zone; expires 24h; add_header Cache-Control "public"; proxy_pass http://*******.com; proxy_cache_bypass $http_cache_control; add_header X-Proxy-Cache $upstream_cache_status; } } 而CURL的结果是: curl -X GET -I http://******/test.png HTTP/1.1 200 OK Server: nginx/1.10.3 Date: Sat, 22 Jul 2017 01:55:56 GMT Content-Type: image/png Content-Length: […]
我只有自己的networking运行(http和https与apache2),但现在我想主办另一个网站。 https没有警告地工作“你的连接不安全” 所以为此,我已经安装了另一台服务器与nginx我想要设置我的STAR_mydomain_com.crt和_mydomain_com.key我在apache2上使用SSL。 server { listen 443; server_name cloud.mydomain.com; error_log /var/log/nginx/cloud.access.log; ssl on; ssl_certificate /etc/nginx/ssl/STAR_mydomain_com.crt; ssl_certificate_key /etc/nginx/ssl/_mydomain_com.key; ssl_protocols TLSv1 TLSv1.1 TLSv1.2; # dont use SSLv3 ref: POODLE location / { proxy_pass http://192.168.1.10/; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade"; proxy_set_header Host $http_host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forward-For $proxy_add_x_forwarded_for; proxy_set_header X-Forward-Proto http; proxy_set_header X-Nginx-Proxy true; […]
我有一个Java应用程序(Confluence)在nginx反向代理之后的Tomcat中运行。 Tomcatconfiguration如下: <Connector port="8090" connectionTimeout="20000" redirectPort="8443" maxThreads="48" minSpareThreads="10" enableLookups="false" acceptCount="10" debug="0" URIEncoding="UTF-8" protocol="org.apache.coyote.http11.Http11NioProtocol" proxyName="wiki.somedomain.com" proxyPort="443" scheme="https" secure="true"/> 和nginx一样如下: location / { proxy_set_header X-Forwarded-Host $host; proxy_set_header X-Forwarded-Server $host; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_connect_timeout 600; client_max_body_size 10M; proxy_pass http://localhost:8090; } 应用程序的前端在一个点上发送POST请求,内容types为application / x-www-form-urlencoded,其中表单URL是“/rest/webResources/1.0/resources”。 该请求通过XHR请求发送。 这导致Tomcat回复以下错误: url中的无效请求urlscheme:%2Frest%2FwebResources%2F1.0%2Fresources; 只支持“http”和“https”。 我希望这是一个普遍的问题,但无法find任何补救措施,除非人们放弃使用nginx作为tomcat应用程序的反向代理,这对我来说不是一个不幸的select。 任何帮助,我们高度赞赏。