我希望nginx的access_log忽略HEAD请求,意味着不要loggingHEAD请求。 这是我的configuration文件,但它不工作,任何人都可以帮忙吗? 非常感谢〜 server { listen 80; server_name localhost; index index.html index.htm index.php default.html default.htm default.php; root /data/data.com; location / { if ($request_method = "HEAD" ) { access_log off; } try_files $uri $uri/ /index.php?$query_string; # deny access to apache .htaccess files location ~ /\.ht { deny all; } location ~ /\.git { deny all; } […]
我有一个Django项目和一个WordPress博客的服务器,我使用Nginx从本地端口(8001为GUnicorn和8081为Apache服务) 我为我的WordPress站点设置了以下Nginx文件,但是我只能访问主页。 所有其他的网页是502.我不明白我想念什么! Nginx:Nginx.conf worker_processes 1; events { worker_connections 1024; } http { sendfile on; 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; # Configuration for Nginx server_names_hash_bucket_size 64; server { return 404; } include /etc/nginx/conf.d/*.conf; include /etc/nginx/sites-enabled/*; } wordpress.conf # WordPress single site […]
我有一个反向代理运行在EC2实例设置上,我打算使用它连接到客户端的临时环境,以便我们可以在应用程序与其网站上线之前检查它们之间的兼容性。 客户将我们的办公室和我们的Heroku盒子列入白名单。 如果我通过办公networking访问反向代理,那么Nginx的日志中就会显示请求,并且浏览器按照预期的方式通过反向代理加载该站点。 我也为我们的Heroku服务器设置了例外,但是请求每次都超时。 奇怪的是,在Nginx日志中没有任何东西出现 – 没有超时或其他失败的请求。 Heroku服务器具有以下静态IP:195.219.8.206,195.219.8.212 有人知道为什么会发生这种情况吗? 这是我的Nginxconfiguration: server { listen 80; server_name company-staging-proxy.redant.cloud; proxy_redirect http://www.uat2prd.company.com http://company-staging-proxy.redant.cloud; proxy_redirect https://www.uat2prd.company.com https://company-staging-proxy.redant.cloud; location / { add_header Set-Cookie Experiment=FH; resolver 127.0.0.1; proxy_pass http://www.uat2prd.company.com; proxy_set_header Accept-Encoding ""; # sub_filter_types *; sub_filter 'www.uat2prd.company.com' 'company-staging-proxy.redant.cloud'; sub_filter 'www.c1.uat2prd.company.com' 'company-c1-staging-proxy.redant.cloud'; sub_filter 'www.c2.uat2prd.company.com' 'company-c2-staging-proxy.redant.cloud'; sub_filter_once off; proxy_set_header Set-Cookie Experiment=FH; proxy_set_header X-Real-IP $remote_addr; […]
我有以下服务器configuration: Django App – Gunicorn – Nginx Nginx将传入的请求导向gunicorn实例。 该网站可以直接到达,也可以通过其他域名redirect。 澄清: 应用程序托pipe在api.myapp.com上 有些客户直接向api.myapp.com发出请求 有些客户向someotherdomain.com发出请求,这也是我控制的。 在someotherdomain.com的nginxconfiguration中,我使用proxy_pass将请求转发给api.myapp.com 在这个设置中,我希望能够获得最终用户的IP地址。 我有以下指令nginx conf api.myapp.com set_real_ip_from my_ip; real_ip_header X-Forwarded-For; real_ip_recursive on; 通过这些指令,当请求来自redirect时,X-Real-IP头被正确设置,但当请求直接进入api.myapp.com时根本没有设置X-Real-IP头,我在这里有点困惑。 我尝试了几个其他的configuration没有成功。 我能做些什么才能获得用户的真正的IPredirect的情况下,并指示accients?
我是一个总是新手,从来没有学到任何有关Linux,服务器或烧瓶,直到今天。 但是我喜欢python,所以我按照这个教程来configuration一个VPS并用烧瓶创build一个网站。 这个教程工作正常,我能够build立我的网站。 但是我没有看到如何更新文件。 这就是我所做的。 教程完成后,网站使用“这是一个例子”等基本数据。 我在我的Windows电脑上创build了我的烧瓶应用程序的改进版本。 我用FileZilla上传新的更新的myproject文件,静态和模板文件夹和一些PNG图像,使用SFTP连接。 当我进入我的网站,它仍然显示旧的基本版本“这是一个例子”,而不是新的上传的文件。 第4步显然是我卡住的地方。 网站不更新。 我在此之前所做的事情。 Flask应用程序在我的本地主机上工作。 那里没有问题。 我在ubuntu服务器上用nano检查过,filezilla实际上把这些file upload到了服务器上。 是的,更新的myproject.py文件在那里。 还尝试了下一个命令,试图重新加载一切: sudo systemctl守护进程重新加载 sudo systemctl启动webgutinberg sudo systemctl启用webgutinberg sudo systemctl重启nginx 所以…我错过了什么? 奖金:我也知道如何自动更新每个file upload到服务器的网站。 我的意图是将图像添加到画廊,我希望file upload到服务器后立即显示它们。 如果可能的话,避免使用databases.f 修复了我自己的问题: sudo systemctl status myproject sudo systemctl status myproject | sed -n 's/.*Main PID: \(.*\)$/\1/gp' | cut -f1 -d' ' | xargs kill […]
我们已经注意到Varnish指标突然出现高峰(参见下面的截图)。 它没有明显的原因发生,并在重新启动清漆后消失。 有没有人有任何线索如何解决这个问题?
我有一个问题。 我已经安装了回声模块,但它不适合我。 这里是我的nginx.conf的一部分: http : //take.ms/pGz4b 所以,当我打开/test/test.html,没有5秒延迟。 我立即得到页面。 Nginx -t显示configuration文件没有错误。 有什么不对? 对不起,我是初学者:) Ubuntu 17.04 Nginx 1.10.3
我在这台主机服务器上拥有root用户访问权限,这个虚拟机托pipe多个网站。 是一个Debian TurnKey虚拟服务器,使用Nginx和ISPConfig作为configuration前端。 我注意到了表演的下降,所以我做了一个顶级的-c和结果显示 9327 web7 20 0 304908 68748 46448 S 7.6 1.2 43:41.26 php-fpm: pool web7 7024 web7 20 0 305632 66556 43384 S 7.3 1.1 28:13.34 php-fpm: pool web7 7233 web7 20 0 305580 66712 43628 S 3.7 1.1 9:54.09 php-fpm: pool web7 10492 web7 20 0 305684 66856 43668 S 3.7 […]
我一直在获取超时导致某些GET请求502错误的网关错误。 我已经尝试将这些行添加到我的nginx站点conf文件中: server { client_max_body_size 500M; client_header_timeout 3000; client_body_timeout 3000; location ~ \.php$ { fastcgi_split_path_info ^(.+\.php)(/.+)$; fastcgi_pass unix:/var/run/php/php7.1-fpm.sock; fastcgi_index index.php; include fastcgi_params; fastcgi_read_timeout 3000; fastcgi_send_timeout 3000; fastcgi_connect_timeout 3000; fastcgi_buffers 128 256k; fastcgi_buffer_size 256k; } } 我也试着用以下方法调整缓冲区大小: fastcgi_buffers 256 512k; fastcgi_buffer_size 512k; fastcgi_buffers 64 128k; fastcgi_buffer_size 128k; fastcgi_buffers 32 64k; fastcgi_buffer_size 64k; 我也尝试将PHP-FPM的conf值改为: max_execution_time = 3000 […]
我已经设置了一个反向代理,从nginx(openresty)向apache发送请求,使用这个只是为了通过openresty来检查请求,而本质上是服务器在apache上运行。 问题是apache是在端口8080和nginx在80,所以每当Apache做一个redirect它redirect到端口8080,我还没有find任何确凿的方法来防止这个,而是有它到端口80。 我的nginx服务器configuration如下 server { listen 80 default_server; server_name localhost; client_max_body_size 1024m; client_body_timeout 300s; location / { proxy_pass http://127.0.0.1:8080; 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; } } 没有卢加虽然。 至于Apache: <VirtualHost *:8080> UseCanonicalName Off ServerName domain.com ServerAdmin [email protected] DocumentRoot /home/user1/environments/production </VirtualHost> <VirtualHost *:8080> ServerAlias *.*.domain.com VirtualDocumentRoot /home/%2/environments/%1 </VirtualHost> <VirtualHost *:8080> […]