是否有可能让Apache或nginx 只接受固定客户端证书,并将有关客户端证书的知识传递给FastCGI响应处理程序?
我在nginx上有以下conf: location ~* ^/assets/ { add_header Access-Control-Allow-Headers content-type; add_header Access-Control-Allow-Origin *; add_header Cache-Control "public, max-age=31536000"; proxy_pass http://nas-mydomain.com; proxy_next_upstream http_500 timeout; gzip_http_version 1.0; gzip_static always; gzip_vary on; etag on; } 我的目标是提供gzipped格式的文件夹中的静态内容。 我当然创build了如下的文件: test.js test.js.gz 我可以达到每个文件和所有标题正确设置以及etags。 但是,gzip检索不起作用。 例如,我testing它是这样的: curl -H "Accept-Encoding: gzip" http://domain.com/assets/test.js | gunzip ## Cutted useless output gunzip: unknown compression format 所以我猜这是行不通的。 我也试着听: strace -p […]
我有一个运行nginx的centos服务器。 服务器ip最近改变了,nginx不再启动 它给出了以下错误信息123.123.123.123。 是服务器的旧IP地址 启动nginx:nginx:[emerg] bind()为123.123.123.123:80失败(99:无法分配请求的地址) 它在哪里读取旧的IP地址?
我是一个初学者的Nginx用户试图代理以下内容: http://subdomain.example.com/mypage/login TO http://some_ip_address/login (不只是/login – 该网站也有其他上下文,例如/静态,/ API等) 虽然我可以在function上做到这一点,但用户可以在他们的浏览器中看到http://some_ip_address ,这是我想避免的。 该configuration看起来像这样: worker_processes 1; events { worker_connections 1024; } http { include mime.types; default_type application/octet-stream; sendfile on; keepalive_timeout 3; server { server_name this_server_ip; location /mypage/ { proxy_pass http://some_ip_address; rewrite ^/mypage/(.*)$ http://some_ip_address/$1 last; } location / { root /var/local/directory/; } } } 为了解决这个问题,我尝试了下面的组合: proxy_pass http://some_ip_address/; (即用斜线) proxy_set_header […]
我有OpenVPNconfiguration为端口443发送非VPN通信到端口4433上我的nginx服务器。当我去https://domain.tld:4433它的工作,虽然https://domain.tld (在哪里OpenVPN侦听端口443 TCP)导致“页面不可用”(Chrome中的ERR_CONNECTION_CLOSED)。 OpenVPNconfiguration: port 443 proto tcp port-share localhost 4433 Nginx的configuration:(实际上并不需要,因为我敢肯定它的工作原理) server { listen 1.2.3.4:4433; server_name domain.tld www.domain.tld; ssl on; ssl_certificate /home/rick/conf/web/ssl.domain.tld.pem; ssl_certificate_key /home/rick/conf/web/ssl.domain.tld.key; error_log /var/log/apache2/domains/domain.tld.error.log error; … }
所以我们的服务器设置如下所示: www <-> nginx <-> backend services 内部服务需要授权,如果用户令牌不正确等等,则内部服务通常会失败,并有403。 现在,我们还使用fail2ban ,它关注nginx的error.log文件中的某些内容,并在一定时间内禁止IP。 我想在这里实现的是当后端服务返回一个403时,nginx会logging一个错误,所以如果有多余的403的fail2ban可以在接下来的十分钟左右禁止IP地址。 目前,如果后端服务响应403,nginx不会logging任何内容到error.log文件。 如何做到这一点? 谢谢。
我试图获得与Perl一起运行的最新的nginx。 我知道Perl本身已经安装,因为我可以从命令行完美运行test.cgi 。 但是,试图从浏览器运行时,我得到一个“502错误的网关”错误。 以下是我目前的configuration: server { listen 80; server_name mysite.net www.mysite.net; access_log /srv/www/mysite.net/logs/access.log; error_log /srv/www/mysite.net/logs/error.log; root /srv/www/mysite.net/www; location / { root /srv/www/mysite.net/www; index index.html index.htm index.php; } location ~ \.php$ { try_files $uri =404; include /etc/nginx/fastcgi_params; fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME /srv/www/mysite.net/www$fastcgi_script_name; } location ~ \.cgi$ { gzip off; include /etc/nginx/fastcgi_params; fastcgi_pass unix:/var/run/fcgiwrap.socket; […]
导致连接到Nginx服务器和等待时间的延迟是由pipe理员控制的吗? 我已经设置GTMetrix来运行每日网页加载速度testing,有时我得到惊人的高取值静态文件。 这里有一个报告 : GTMetrix分析发生在20分钟前。 我们的1GB Linodenetworking服务器远没有加载。 Load average: 0.17 0.06 0.06 ,分析过程中5分钟间隔内CPU利用率低于1%,nginx连接低于1 /秒。 nginx的configuration文件没有什么特别之处,几周之内没有改变: server { listen 80; listen [::]:80; listen 443 ssl; listen [::]:443 ssl; server_name analytics.idorecall.com; ssl_certificate …; ssl_certificate_key …; root /var/www/piwik; location / { index index.php; } location ~* \.(ico|css|js|gif|png|jpe?g)$ { add_header Access-Control-Allow-Origin idorecall.com; access_log off; expires max; break; } location […]
我有一个rails应用程序通过capistrano在aws ec2实例上部署,并且在服务器上也安装了nginx客户端。 每当我尝试使用提供的DNS或公共IP访问我的应用程序时,我所得到的只是浏览器加载了一段时间而没有响应,甚至没有从nginx的错误页面。 这里是我的nginxconfiguration(/ etc / nginx / sites-enabled / default) server { listen 80 default_server; listen [::]:80 default_server ipv6only=on; server_name <public ip>; passenger_enabled on; rails_env production; root /home/ubuntu/myapp/current/public; # redirect server error pages to the static page /50x.html error_page 500 502 503 504 /50x.html; location = /50x.html { root html; } } 在运行命令“sudo nginx”时,这是我得到的回应: […]
在我的工作地点,我们已经用完了可用的IP地址,以便分配给我们面向公众的UAT服务器。 因此,我们将所有stream量从另一个服务器IP地址的端口9999路由到我们的UAT服务器上的端口80。 这在大多数情况下工作正常,但testing外部服务,如贝宝变得不可能,因为贝宝从回叫url中删除端口号,所以我们面向公众的UAT服务器不能与付款网关交互。 作为一个解决方法,我build议如下: 购买具有唯一IP地址的最便宜的Digital Ocean容器。 指向所有UAT域的DNS到这个容器。 阻止除UAT服务器的容器以外的所有stream量。 设置某种反向代理将所有stream量从DO容器路由到UAT服务器。 我不知道怎么做的部分是反向代理部分。 我假设我需要Nginx或Varnish。 但是,该解决scheme需要处理用户会话和file upload,DO容器只能作为代理进行操作,不能存储这些信息。 这可能吗? 如果是的话,我该怎么办呢? 我没有偏好DO容器的操作系统或软件,所以我们欢迎任何build议。 请不要告诉我,我们应该如何获得另一个IP地址,而不是为了这个冗长的解决scheme。 我清楚知道这是过分的,但目前我们不能购买任何其他IP块,所以这是一个临时措施,直到发生这种情况。