我在Nginx和FPM下运行一个WordPress网站。 在stream量的情况下,杀死PHP进程和网站停止为所有用户工作。 这是我从日志中发现的。 有什么办法,网站不停止工作,但如果有更多的要求比我们已经configuration将忙于单身或以其他方式,这将不适用于这些新用户,但对于老用户它工作正常(不要停止整个网站)。 [20-Mar-2016 03:34:01] NOTICE: error log file re-opened [21-Mar-2016 05:51:44] WARNING: [pool www] seems busy (you may need to increase pm.start_servers, or pm.min/max_spare_servers), spawning 8 children, there are 4 idle, and 27 total children [23-Mar-2016 06:56:13] WARNING: [pool www] child 8707 exited on signal 11 (SIGSEGV) after 231123.827974 seconds from start [23-Mar-2016 […]
我很难理解如何为Nginx重写这些Apache ProxyPass指令: ProxyPass /api/socket ws://localhost:8082/api/socket ProxyPassReverse /api/socket ws://localhost:8082/api/socket ProxyPass / http://localhost:8082/ ProxyPassReverse / http://localhost:8082/ 所以,如果我已经尝试过: 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_redirect http://mydomain:8082/ https://mydomain/alias/; proxy_redirect ws://mydomain:8082/api/socket ws://mydomain/alias/api/socket; proxy_pass http://localhost:8082/; 但没有成功。
我怎么能deny all; 访问所有前面的wordpress文件,除了wp-login.php和wp-admin ? 我目前阻止访问所有wp-*包括wp-admin location ~ ^/(index\.php|wp-.*\.php) { deny all; } 尝试代码块: # Deny Access to all of WordPress Front End files except wp-login.php, wp-admin, and default.php location ~* !^/(default.(.*)$)|!^/(wp-login.(.*)$)|!^/(wp-admin/) { deny all; } 全部仍然可以访问
当我设置我的反向代理从它自己的端口80转发到它自己的端口8080时,我这样做,我得到以下警告 2016/03/28 22:05:59 [alert] 4193#0: 512 worker_connections are not enough 这可能是无限循环的结果。 在Nginx的configuration:前端反向代理到另一个端口的接受的答案,用户写道:“我假设nginx不是服务器端口5010以及80听,正确吗? 那是因为反向代理人不能转发给自己吗? 还是有另一个原因,为什么这个无限循环正在发生,这个评论只是一个红色的鲱鱼? 以下是我的nginx.conf。 当我转到router.example.com时,会收到警告。 当我删除#### BEGIN BAD LINES #### ,效果很好。 user root; worker_processes 1; worker_cpu_affinity 0101; master_process off; worker_priority 10; error_log /tmp/var/log/nginx/error.log; pid /tmp/var/run/nginx.pid; worker_rlimit_nofile 8192; events { worker_connections 512; } http { log_format main '$remote_addr – $remote_user [$time_local] $status ' '"$request" $body_bytes_sent […]
我想要正确设置由nginx代理的域的X-Real-IP,它也位于亚马逊ELB之后。 即 AMAZON ELB <=> NGINX PROXY <=> REST APP1 <=> REST APP2 到目前为止,我发现以下正确的工作,并防止欺骗的IP。 我在nginx.conf中有全局的这个集合 real_ip_header X-Forwarded-For; set_real_ip_from 10.0.0.0/8; real_ip_recursive on; 不过,我也有一些REST应用程序位于NGINX之后 我的其他应用程序将使用x-real-ip(如果已设置)或x-forwarded-for。 在正常使用情况下,真实的客户端IP是正确的。 在伪造的IP攻击中,设置了x-real-ip和x-forwarded-for头中的一个或两个,我在REST客户端中看到伪造的IP。 但是,nginx显示正确的客户端IP。 目前在域名主机,我已经设置 proxy_pass_request_headers on; 如何将x-real-ip设置为REST应用程序的真正可信IP? 我认为我需要一个proxy_set_header线与X-Real-IP。 但是,我怎样才能引用real-ip模块设置的真实IP头?
我想工作像http://host/test.php简单的url,请注意有没有尾/尾。 我从nginx站点的标准configuration开始+ serverfault: location ~ [^/]\.php(/|$) { fastcgi_split_path_info ^((?U).+\.php)(.*)$; if (!-f $document_root$fastcgi_script_name) { return 404; } include fastcgi_params; fastcgi_param PATH_INFO $fastcgi_path_info; fastcgi_param PATH_TRANSLATED $fastcgi_path_info; fastcgi_param SCRIPT_FILENAME $fastcgi_script_name; fastcgi_pass unix:/run/php-fpm/www.sock; fastcgi_index index.php; } 结束http://host/test.php/工作,但http://host/test.php无尾/不工作。 我尝试改变到这样的configuration: location ~ \.php$ { fastcgi_split_path_info ^/(.+\.php)(.*)$; if (!-f $document_root$fastcgi_script_name) { return 404; } include fastcgi_params; fastcgi_param PATH_INFO $fastcgi_path_info; fastcgi_param PATH_TRANSLATED $fastcgi_path_info; […]
我有一个带有bootstrap js框架的nginx webserver。 我正在试图让CSS能够加载字体文件。 虽然当浏览器试图访问字体文件时,我得到错误403。 我已经环顾serverfault那些有类似的问题,虽然我不成功应用他们的解决scheme。 例如:“ 我怎样才能让nginx支持@ font-face格式并允许访问控制允许来源? 以下是我的错误和我的服务器configuration: 错误: 2016/01/07 10:30:10 [error] 20770#0: *26 open() "/usr/share/nginx/html/fonts/glyphicons-halflings-regular.ttf" failed (13: Permission denied), client: 0.0.0.0, server: localhost, request: "GET /fonts/glyphicons-halflings-regular.ttf HTTP/1.1", host: "localhost", referrer: "http://localhost/css/bootstrap.min.css" /etc/nginx/conf.d/default.conf: server { listen 80; server_name localhost; #charset koi8-r; #access_log /var/log/nginx/log/host.access.log main; location / { root /usr/share/nginx/html; index index.html index.htm; if […]
我正在用listen unix:/tmp/foo.sock;运行nginx listen unix:/tmp/foo.sock; 。 不幸的是,该套接字属于root和world-writable / readable: srw-rw-rw- 1 root root 0 Apr 11 00:37 /tmp/foo.sock 虽然我希望它由nginx用户拥有(例如www-data )并拥有模式srw-rw—- 。 我在nginx文档中找不到任何相关的东西。 而Google只会告诉我有关php-fpm的后端套接字。
我读过这篇文章http://bneijt.nl/blog/post/name-based-virtual-hosting-with-nginx/ 摘录如下: server { server_name ~^((?<subdomain>.*)\.)?(?<domain>[^.]+)\.(?<tld>[^.]+)$; if ($subdomain = "") { set $subdomain "_"; } location / { index index.html; root /srv/http/vhost/${domain}.${tld}/${subdomain}; } } 我模仿它,写下我的configuration: server { server_name ~^((?<subdomain>.*)\.)aa\.com$; if ($subdomain = "") { set $subdomain "www"; } location / { root /var/www/${subdomain}.aa.com/public; index index.html index.htm; } } 题: 如果inputwww.aa.com ,它可以工作,但inputaa.com ,它不能工作,域名parsing是好的,有什么问题?
我在Docker容器中使用nginx 1.9.2(使用pagespeed和geoIP),在Google容器引擎上运行。 它作为运行php-fpm(php7)的另一个容器的代理。 我也使用fastcgi代理。 我觉得它很慢,所以我开始看着不同的可用graphics,我看到这个内存图: 有人见过这样的事吗? 这是一种常见的模式吗? 实际上是否可以说一个nginxconfiguration文件是“正常的”或不? 如果你是我,你会怎么做? 这是顶部: Mem: 1352376K used, 392976K free, 0K shrd, 29581464K buff, 29581520K cached CPU: 4% usr 1% sys 0% nic 94% idle 0% io 0% irq 0% sirq Load average: 0.04 0.08 0.10 2/278 55 PID PPID USER STAT VSZ %VSZ %CPU COMMAND 7 1 www-data S […]