Do I need to add any additional configuration to enable keepalive to my PHP-FPM backend? upstream php_backend { zone upstreams 64K; server unix:/var/run/php-fpm.sock max_fails=1 fail_timeout=2s; keepalive 10; } # Pass off php requests to PHP-FPM location ~* \.php { try_files $uri =404; access_logby Mayhem30 - How to...
My error log gets about 100 of these errors every day. I'm using Nginx 1.19.6 - OpenSSL 1.1.1i ssl_protocols TLSv1.2 TLSv1.3; ssl_session_cache shared:SSL:20m; ssl_session_timeout 2h; ssl_stapling on; ssl_stapling_verify on; resolver 127.0.0.1; resolver_timeout 5s; Any idea what I can do to fix this? 2020/12/16 16:59:16 2197#0: *880698 SSL_do_handshake() failed (Sby Mayhem30 - Other discussion
I solved the issue by doing this instead : location ~* /(cars|trucks|bikes|motorcycle|quad-bikes) { rewrite ^/(+)/([0-9]+)(.*)$ /page.php?id=$2 last; ... ... } The regex (+) allows me to use characters a-z (case insensitive) with possible dashes in my category / page names.by Mayhem30 - How to...
I'm trying to do a group capture in a Nginx location block and it's not working for me. Is what I am trying to do even possible? location ~* /(?<cat>cars|trucks|bikes|motorcycle|quads) { rewrite ^/$cat/([0-9]+)(.*)$ /page.php?id=$1 last; } The error message I am receiving is : "^/$cat/([0-9]+)(.*)$" does not match "/cars/120/new-car-rentals/" I haveby Mayhem30 - How to...
I had this issue as well, and the solution is to make sure your "allow / deny / auth" configuration block(s) always sit -above- your PHP & Static file configuration. location ~* /admin { auth_basic "Administrator Login"; auth_basic_user_file /path/to/.htpasswd } # Pass off php requests to Apache location ~* \.php { try_files $uri =404; inclby Mayhem30 - How to...
An easy way to solve this issue is to create a "allowmyip.conf" file and include it anywhere you wish. allowmyip.conf file : allow 11.22.33.44 deny all; Then in your server block :location ^~ /apc/ { # Allow home include /etc/nginx/allowmyip.conf; } This way it will be real easy to manage if your IP address changes. Just update your IP Address in the allowby Mayhem30 - Nginx Mailing List - English
I feel something needs to be addressed so Nginx will select more than one location block for processing a request. Let's say I'm running Nginx in front of Apache and I want to secure the WordPress login page : location ~* wp-login.php { allow 22.131.12.14; deny all; include /usr/local/etc/nginx/proxypass.conf; proxy_pass http://127.0.0.1:80; } The problem here is that ALL static contby Mayhem30 - Ideas and Feature Requests
I'm having a heck of a time setting allow / deny rules for certain directories and files + getting Nginx to keep handling other location rules. For example, I want to only allow my IP address access to the WordPress login page: location ~* wp-login.php { allow 22.131.12.14; deny all; } # Pass off php requests to Apache location ~* \.php$ { include /by Mayhem30 - Nginx Mailing List - English
Sure, no problem. proxy_redirect off; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; client_max_body_size 10m; client_body_buffer_size 128k; proxy_connect_timeout 90; proxy_send_timeout 90; proxy_read_timeout 90; proxy_buffer_sizeby Mayhem30 - How to...
I have a similar setup and I just let apache handle all the mod rewrites & php files. Here is what I use to make that happen - it works great. server { listen 123.45.67.89:80; server_name example.com; root /www-data/example.com/httpdocs; index index.php; access_log off; error_logby Mayhem30 - How to...
Is there a way I can setup nginx to serve static content from static.example.com - without having to modify all my php files to reflect where to get the images from? I was hoping there was some trick I can do in the nginx conf files.by Mayhem30 - How to...