我有nginx代理与后端。 有时后端返回HTTP 500。 在这种情况下,我希望nginx将错误代码从500更改为503。 这可能吗? 注意:我不介意将“全局”500错误replace为503。
所以,当我在我的服务器上执行curl -i http://example.com时,我在正文中得到了这个响应: <html> <head><title>301 Moved Permanently</title></head> <body bgcolor="white"> <center><h1>301 Moved Permanently</h1></center> <hr><center>nginx</center> </body> </html> 它显示我正在运行nginx,我想删除这些信息。 这里是我的nginx.confredirect到HTTPS(与我尝试更改301响应正文一起): server { listen 80; server_name localhost; error_page 301 = /301.html; location /301.html { return 301 "<h1>use https</h1>"; } return 301 https://$host$request_uri; } 任何想法如何改变301响应体?
访问我们的Web服务器的第三方Web工具似乎使用Java 6,它不支持DH参数> 1024位。 它不能连接到我们的服务器,因为我们有一个dhparams文件设置为4096位。 在Nginx中,dhparams文件使用ssl_dhparam参数在nginx.conf设置。 据推测,如果我们重新生成1024位dhparams.pem文件,这将削弱每个人的安全。 有没有办法让这个旧的客户端连接1024位dhparams,而为其他人使用4096? 更麻烦的是,Java 6似乎没有SNI支持。 有处理这种情况的好方法吗?
我真的很努力得到一个新的Debian 8服务器,configurationnginx和HTTP / 2 我用apt-get安装了nginx: apt-get install nginx 这一切运行良好,我用nginx -V得到这个; configuration参数:–prefix = / etc / nginx –sbin -path = / usr / sbin / nginx –modules -path = / usr / lib / nginx / modules –conf-path = / etc / nginx / nginx。 conf –error-log-path = / var / log / nginx / error.log […]
我有域example.com和子域blog.example.com 。 我有一个运行在localhost:5000的独angular兽应用程序,并使用Nginx作为反向代理。 运行example.com时,我没有任何问题。 不过,我想添加子域支持,并有一些问题。 我在example.com/blog有一些内容。 我想blog.example.com指向它,没有用户知识,使用重写。 我想映射所有的URL,所以: blog.example.com – > localhost:5000/blog blog.example.com/index.php – > localhost:5000/blog/index.php blog.example.com/foo/bar – > localhost:5000/blog/foo/bar 我迄今为止的最佳尝试是这样的: server { listen 80; server_name blog.example.com; location / { proxy_pass http://localhost:5000/blog/$uri; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header Host $http_host; proxy_set_header X-Forwarded-Proto $scheme; proxy_redirect off; } client_max_body_size 4G; keepalive_timeout 10; } 这正确地重写blog.example.com ,但与blog.example.com/index.php失败: $ curl -v 'http://blog.example.com' […]
我使用nginx作为我的node.js应用程序。 我已经使用Digitalocean教程来configurationnginx和https的使用。 现在,下面的工作: http:// example.com – > https:// example.com example.com – > https:// example.com www.example.com – > https:// example.com http:// www.example.com – > https:// example.com 但是当我inputhttps:// www.example.com时,它不会redirect到https:// example.com 这里是我的nginx congif网站,可用/默认 # HTTP – redirect all requests to HTTPS: server { listen 80; listen [::]:80 default_server ipv6only=on; return 301 https://$host$request_uri; } # HTTPS – proxy requests […]
我有一个数字海洋液滴上的nginx服务器,有2个CPU和4GB内存。 我正在运行一些小WP网站,没有太多的stream量,但似乎我可以毫不费力地将服务器推到100%的CPU。 我实际上只是垃圾邮件(1-2 /秒)硬刷新,服务器命中100%,并引发错误500。 我对服务器pipe理和Nginx来说还是很新的,所以我试图debugging到我所知道的最好的状态 – 而且我一直回到我的configuration不够好。 服务器信息: 2个CPU 4GB内存 CentOS 7 VestaCP 纯Nginx 仅运行WP站点 Nginx的conf: # Server globals user nginx; worker_processes auto; worker_rlimit_nofile 65535; error_log /var/log/nginx/error.log crit; pid /var/run/nginx.pid; # Worker config events { worker_connections 1024; use epoll; multi_accept on; } http { # Main settings sendfile on; tcp_nopush on; tcp_nodelay on; client_header_timeout 3m; […]
我有一个问题,我近两个月来一直无法解决。 我已经build立: 在GoDaddy帐户的子域名中,我创build了Alogging并将其指向IP地址。 我的GCE实例的地址…我想我的Nginxconfiguration没问题。 我的问题是,当我访问我的网站的URL,它会显示IP地址,而不是mysubdomain.example.com 。 我不想让我的IP地址显示我想要在浏览器中可见的URL中的子域名。 我的疑问是我的laravel应用程序的.htaccess导致IP地址始终显示在URL中。 在老爹帐户,这是我如何创build在DNSpipe理。 type=A, Host=mysubdomain, Point to=ip address, ttl=1. 也在下面有子域的转发部分,我点击添加button,我inputmysubdomain,转发到http:// ip地址,forwrd type = permanent(301),settings =只转发 这是我的服务器GCE中的Nginxconfiguration server { listen 80; listen [::]:80; root /var/www/pro1/public/; # Add index.php to the list if you are using PHP index index.php index.html index.htm; server_name mysubdomain.example.com; location / { # First attempt to serve […]
我在几台机器上运行WordPress版本4.7.1(Ubuntu 14.04.5 + Nginx)并且想要升级到4.7.3。 但是,当我尝试通过WP-Admin运行更新时,它会提供: 更新无法安装,因为我们将无法复制一些文件。 这通常是由于不一致的文件权限:wp-admin / includes / update-core.php 所以我认为是一些权限问题,我更新使用以下内容: find /var/www/site -type f -exec chmod 664 {} \; find /var/www/site -type d -exec chmod 775 {} \; chmod 600 /var/www/site/wp-config.php 但是,这也没有纠正这个问题 – 仍然给出了同样的错误。 如果我运行chown -R www-data:www-data . 它似乎工作正常,但担心安全…任何想法?
我试着用TLS1.3configurationnginx 1.11.12,但每次失败。 你能解释我如何使用nginx 1.11.12和openssl 1.1.0e?