我正在尝试做基于位置的Fastcgi服务器。 所有请求/ api / v1 / – >服务器v1:9000和/ api / v2 / – >服务器v2:9000我的nginxconfiguration是 server { listen 80; index index.php index.html; root /var/www/public; location ~ \.php$ { fastcgi_split_path_info ^(.+\.php)(/.+)$; fastcgi_pass v1:9000; if ( $uri ~ "^/api/v1/") { fastcgi_pass v1:9000; } if ( $uri ~ "^/api/v2/") { fastcgi_pass v2:9000; } fastcgi_index index.php; include fastcgi_params; fastcgi_param SCRIPT_FILENAME […]
我有一个运行Windows server 2008 datacenter的VPS ,带有一个静态IP地址。 我可以通过特定的端口从Internet访问我的Web服务,例如mydomain.com:3000/api和mydomain.com:4000/api 。 我想将此Web服务访问地址更改为子域方法(子),如App1WS.mydomain.com/api和App2WS.mydomain.com/api 更新 我将这一行添加到host文件 127.0.0.1 mobileapp.myrealdomain.com 然后在nginx中,我在最后添加这些行 server { listen 80; #root html; root c:/apps/web; server_name mobileapp.myrealdomain.com; location / { proxy_pass "http://127.0.0.1:3000"; } } 然后我开始了我的回环项目,可以通过以下方式访问: C:\apps\mobileapp>node . Web server listening at: http://localhost:3000 Browse your REST API at http://localhost:3000/explorer 然后,我将Alias(CNMAE)logging添加到DNS: alias name: mobileapp FQDN: mobileapp.myrealdomain.com FQDN for target host: 127.0.0.1:3000. […]
我有一个可以在/auth-admin上进行授权的服务。 我可以确认它适用于静态网页。 但是,如果页面有一些像phpmyadminloginapi调用, auth_request将打破它。 什么是设置auth_request的正确方法? server { listen 443 ssl; server_name example.com; location / { proxy_pass http://192.168.1.13:8085; 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_set_header X-Forwarded-Proto $scheme; } location /auth-admin { internal; proxy_pass http://192.168.1.13:8085/auth.php?admin; } location /phpmyadmin/ { auth_request /auth-admin; proxy_pass http://192.168.1.13:8086/; add_header X-Frame-Options "SAMEORIGIN"; proxy_set_header X-Forwarded-Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-Proto […]
我做了这个https://www.digitalocean.com/community/tutorials/how-to-secure-apache-with-let-s-encrypt-on-ubuntu-14-04 然后从下面的apache切换到nginx *** https://www.digitalocean.com/community/tutorials/how-to-secure-nginx-with-let-s-encrypt-on-ubuntu-14-04 ***一切都很好。 但现在facebookdebugging器给我:curl错误:SSL_CACERT SSL证书问题:无法获得本地发行者证书 ***问:如何重新下载证书颁发机构的所有证书,并在我的情况下重新下载? Alexs-MacBook-Air:~ alex$ openssl s_client -connect goeasysmile.com:443 CONNECTED(00000003) depth=0 /CN=goeasysmile.com verify error:num=20:unable to get local issuer certificate verify return:1 depth=0 /CN=goeasysmile.com verify error:num=27:certificate not trusted verify return:1 depth=0 /CN=goeasysmile.com verify error:num=21:unable to verify the first certificate verify return:1 — Certificate chain 0 s:/CN=goeasysmile.com i:/C=US/O=Let's Encrypt/CN=Let's Encrypt Authority X3 […]
是否有可能在查询string中编码$request_uri的值,如下面的redirect? error_page 401 = @error401 location @error401 { return 302 /sign-in?t=$request_uri; } 上面的例子工作,但是$request_uri是附加的,所以在/foo?a=1&b=2上的401redirect变成字面/sign-in?t=/foo?a=1&b=2而不是/sign-in?t=/foo%3Fa%3D1%26b%3D2
我有一台运行开源Nginx 1.10.3的服务器,它有一个非常简单的configuration:提供静态文件,如果文件不存在,请求被发送到后端。 我需要限制到这个后端的活动连接。 很简单,是不是,使用upstream server max_conns ,哪个 限制同时连接到代理服务器的最大数量。 此外,这只是在1.11.5介绍的,所以还没有。 有什么聪明的想法/解决方法在那里处理这种情况? [此服务器目前正在使用jessie-backports运行Debian jessie 。 我可以升级到stretch ,并使用stretch-backports 。 但是,在这样做之前,因为我对这个系统非常满意,我想检查一下是否有其他的方法。 你知道:永远不要改变正在运行的系统…]
这是我目前的服务器块(下面)。 我有一个单独的WordPress博客安装在/博客,需要路由/博客目录“/ home / forge / example.com/public/blog”。 我已经尝试了几个选项,并感到遗憾,所以任何意见都感激地收到。 # FORGE CONFIG (DOT NOT REMOVE!) include forge-conf/example.com/before/*; server { listen 443 ssl http2; listen [::]:443 ssl http2; server_name example.com; root /home/forge/example.com/public; # FORGE SSL (DO NOT REMOVE!) ssl_certificate /etc/nginx/ssl/example.com/server.crt; ssl_certificate_key /etc/nginx/ssl/example.com/server.key; ssl_protocols TLSv1 TLSv1.1 TLSv1.2; ssl_ciphers 'REMOVED FOR DEMO'; ssl_prefer_server_ciphers on; ssl_dhparam /etc/nginx/dhparams.pem; add_header X-Frame-Options "SAMEORIGIN"; […]
我有一个看起来像这样的nginxconfiguration: location ^~ /movies { alias /var/dp.cx/movies/current/public; fastcgi_index index.php; try_files $uri /movies/index.php; location ~* \.php { fastcgi_pass unix:/run/php/php7.1-fpm.sock; fastcgi_split_path_info ^(.+\.php)(.*)$; include /etc/nginx/fastcgi_params; } } 这是一个Laravel应用程序,几乎完全开箱即用。 但是,这个configuration有一些小问题。 击中/movies触发一个404.击中/movies/工程成功。 打到其中一个分页URL( /movies/test?page=2 )没有来自查询string的信息。 我不知道我在哪里find了这个configuration,但是它似乎是我用nginx + fpm和子目录URLfind的“工作”configuration最接近的。
我有一个运行在nginx反向代理之后的Apache2 / svn服务器。 基本authentication是由nginx完成的,所以基本上,反向代理背后的Apache2服务器不需要做任何authentication的事情。 我有一个在svn mod_authz_svn授权configuration中的用户的条目: [/] * = r test = rw 用户testing可以签出但不能提交。 我不知道如何提供authentication的用户从nginx到托pipesvn安装的apache2服务器。 我试过的: 在nginx反向代理中设置远程用户HTTP标头 proxy_set_header REMOTE_USER $remote_user; 转发授权标题 proxy_set_header Authorization $http_authorization; proxy_pass_header Authorization;
我在虚拟环境中设置安全路由时遇到问题。 对网站和REST API的所有HTTP请求都正常工作。 证书由我工作的公司提供,并且是我们域的通配证书。 我的问题是证书的位置,这是我无法访问。 我试图在许多地方configurationSSL,但它只能部分工作。 为了尝试路线,我使用邮差和一个普通的浏览器(Chrome)。 我可以成功访问网页,login,用JSON发送请求到REST API。 所有url都以http://开头。 当我做的完全一样,但与https:// ,浏览器显示该网站是不安全的。 邮递员也显示连接到URL时出错。 http://不会发生这种情况。 设置看起来像这样: 我的虚拟系统的设置 网关服务器作为多个虚拟机的入口。 我的应用程序运行在其中之一。 网关运行apache2以方便路由到它托pipe的所有虚拟机。 而且,它是所有虚拟环境中SSL相关事务的处理程序。 我正在开发基于Symfony框架的PHP Web应用程序。 为了实现与此应用程序的持续集成,我们在Docker实例中运行应用程序。 在Jenkins成功构build之后,脚本会启动一个新的Docker镜像。 Docker映像运行托pipe我的应用程序的Nginx服务器 。 我曾尝试在我的Nginxconfiguration和apache2configuration中configuration证书。 两者都没有成功的结果。 我发现通配符证书不适用于子子域。 因此,我认为my-app.development.mycompany.com将无法正常工作。 将URL更改为development.mycompany.com/my-app/失败,因为PHP应用程序在/my-app/ part中find了。 这导致应用程序的路由select问题,并阻止其他虚拟机的应用程序。 我想了解如何configurationapache2主机来处理SSL。 为了能够在未来在这个虚拟环境中开发更多的应用程序,我想设置这个,以便HTTPS覆盖所有的虚拟机。 为什么此设置适用于HTTP,但不适用于HTTPS? 入口点的虚拟主机configuration可以在下面find <VirtualHost *:444> ServerName development.mycompany.com SSLEngine on SSLCertificateFile /etc/apache2/ssl/certificate_bundle.crt SSLCertificateKeyFile /etc/apache2/ssl/certificate.key #RewriteEngine on ProxyPreserveHost On <Proxy *> Order Deny,Allow […]