So I noticed some unusual stuff going on lately mostly to do with people using proxies to spoof / fake that files from my sites are hosted of their sites. Sitting behind CloudFlare the only decent way I can come up with to prevent these websites who use proxy_pass and proxy_set_header to pretend that files they are really hotlinking of my site is on and hosted by theirs is using Nginx's built iby c0nw0nk - Nginx Mailing List - English
gariac Wrote: ------------------------------------------------------- > This page has all the secret sauce, including how to limit the number > of connections. > > https://www.nginx.com/blog/mitigating-ddos-attacks-with-nginx-and-ngin > x-plus/ > > I set up the firewall with a higher number as a "just in case." Also > note if you do streaming outsiby c0nw0nk - Nginx Mailing List - English
I am sure (well would hope) they would have the common sense to edit it to their own needs. B.R. Wrote: ------------------------------------------------------- > I just hope that code won't be used by the owner of wwwooowww.wtf for > example. > --- > *B. R.* > > On Sat, Sep 10, 2016 at 2:46 PM, c0nw0nk <nginx-forum@forum.nginx.org> > wrote: > > >by c0nw0nk - Nginx Mailing List - English
Just fixed my problem completely now :) For anyone who also uses Lua and wants to overcome this cross browser compatibility issue with expires and max-age cookie vars. if ($host ~* www(.*)) { set $host_without_www $1; } set_by_lua $expires_time 'return ngx.cookie_time(ngx.time()+2592000)'; add_header Set-Cookie "value=1;domain=$host_without_www;path=/;expires=$expires_time;Max-Age=by c0nw0nk - Nginx Mailing List - English
Can you provide a example also I seem to have a new issue with my code above it is overwriting all my other set-cookie headers how can i have it set that cookie but not overwrite / remove the others it seems to be a unwanted / unexpected side effect.by c0nw0nk - Nginx Mailing List - English
Solved it now i forgot in lua i declare vars from nginx different. header_filter_by_lua ' ngx.header["Set-Cookie"] = "value=1; path=/; domain=" .. ngx.var.host_without_www .. "; Expires=" .. ngx.cookie_time(ngx.time()+2592000) -- +1 month 30 days ';by c0nw0nk - Nginx Mailing List - English
if ($host ~* www(.*)) { set $host_without_www $1; } header_filter_by_lua ' ngx.header["Set-Cookie"] = "value=1; path=/; domain=$host_without_www; Expires=" .. ngx.cookie_time(ngx.time()+2592000) -- +1 month 30 days '; So i added this to my config but does not work for me :(by c0nw0nk - Nginx Mailing List - English
So i read that IE8 and older browsers do not support "Max-Age" inside of set-cookie headers. (but all browsers and modern support expires) add_header Set-Cookie "value=1;Domain=.networkflare.com;Path=/;Max-Age=2592000"; #+1 month 30 days Apprently they support "expires" though so i changed the above to the following but now the cookie says it will expire at endby c0nw0nk - Nginx Mailing List - English
c0nw0nk Wrote: ------------------------------------------------------- > Francis Daly Wrote: > ------------------------------------------------------- > > On Wed, Aug 31, 2016 at 01:30:30PM -0400, c0nw0nk wrote: > > > > Hi there, > > > > > Thanks works a treat is it possible or allowed to do the > following > > in a > > > nginxby c0nw0nk - Nginx Mailing List - English
Francis Daly Wrote: ------------------------------------------------------- > On Wed, Aug 31, 2016 at 01:30:30PM -0400, c0nw0nk wrote: > > Hi there, > > > Thanks works a treat is it possible or allowed to do the following > in a > > nginx upstream map ? and if so how i can't figure it out. > > I think it is logically impossible. > > > I cacby c0nw0nk - Nginx Mailing List - English
Valentin V. Bartenev Wrote: ------------------------------------------------------- > On Tuesday 30 August 2016 14:25:28 c0nw0nk wrote: > > So this is a fun one. > > > > As allot of people probably already know you can't use "IF" on > upstream > > values since if conditions are executed before any "$upstream_" > conditions. > >by c0nw0nk - Nginx Mailing List - English
Thanks works a treat is it possible or allowed to do the following in a nginx upstream map ? and if so how i can't figure it out. I cache with the following key. fastcgi_cache_key "$session_id_value$scheme$host$request_uri$request_method"; if the upstream_cookie_logged_in value is not equal to 1 how can I set $session_id_value ''; make emptyby c0nw0nk - Nginx Mailing List - English
So this is a fun one. As allot of people probably already know you can't use "IF" on upstream values since if conditions are executed before any "$upstream_" conditions. But with a map directive it might just be possible to combine 2 upstream maps together and have a output based on the conditions matched. Here is what I am trying to achieve. If the upstream returnsby c0nw0nk - Nginx Mailing List - English
Christos Chatzaras Wrote: ------------------------------------------------------- > Is any way to get the body of a php post upload to match using regex > the filename of a php upload? I want to block file uploads with .php > extension. I found that I can do it with nasxi but I want to see if I > can avoid it. > _______________________________________________ > nginx mailiby c0nw0nk - Nginx Mailing List - English
It works by adding a X-Accel-Expires header to my php output what the fastcgi_cache will follow what also then means if i use proxy_cache it would follow it too :)by c0nw0nk - Nginx Mailing List - English
Maxim Dounin Wrote: ------------------------------------------------------- > Hello! > > On Fri, Aug 26, 2016 at 11:01:05AM -0400, c0nw0nk wrote: > > > So I have been trying to make the fastcgi_cache_valid value based on > user > > request. > > > > if ($request_uri ~ "/url1" ) { > > set $cachetime "any 5s"; > > }by c0nw0nk - Nginx Mailing List - English
So I have been trying to make the fastcgi_cache_valid value based on user request. if ($request_uri ~ "/url1" ) { set $cachetime "any 5s"; } if ($request_uri ~ "/url2" ) { set $cachetime "any 5m"; } These did not work because it turns out your not allowed to have a dynamic variable within the fastcgi_cach_valid command. fastcgi_cache_valid $cacheby c0nw0nk - Nginx Mailing List - English
I sorted out this problem now Here was my soloution. if ($host ~* www(.*)) { set $host_without_www $1; } add_header Set-Cookie "logged_in=1;Domain=$host_without_www;Path=/;Max-Age=315360000";by c0nw0nk - Nginx Mailing List - English
So i am using Nginx to set a header now my PHP app sets this header too but it sets the cookie with a domain of ".networkflare.com" Nginx keeps setting it as "www.networkflare.com" i need to overwrite the cookie not create a new one. I have tried the following : add_header Set-Cookie "logged_in=1;Path=/;Max-Age=315360000"; That created a new cookie withby c0nw0nk - Nginx Mailing List - English
So i found the following for Drupal https://forum.nginx.org/read.php?2,220510,220563#msg-220563 http { map $http_cookie $session_id { default ''; ~SESS(?<session_guid>[[:alnum:]]+) $session_guid; } } server { location ~ \.php$ { fastcgi_cache_key $session_cookie$request_method$scheme$host$request_uri; } } And want to implement it for Joomla but Joomla's cookies regex do notby c0nw0nk - Nginx Mailing List - English
Maxim Dounin Wrote: ------------------------------------------------------- > Hello! > > On Mon, Jan 18, 2016 at 08:54:42AM -0500, c0nw0nk wrote: > > > So i have two machines in different locations. > > > > Web server is C:/ > > > > Storage Server is Z:/ (This one is the external mapped hard drive) > > > > Now when you upload fby c0nw0nk - Nginx Mailing List - English
So i have two machines in different locations. Web server is C:/ Storage Server is Z:/ (This one is the external mapped hard drive) Now when you upload files to nginx especialy large files in my tests 2GB. Nginx then pushes the file from the temp location to the Z drive, The issue with this is it locks up and stops serving traffic until it finishes pushing the file onto the storage serverby c0nw0nk - Nginx Mailing List - English
So its because i'm using PHP's built in file session handler ? Should i switch it to maybe Wincache or something ?by c0nw0nk - Nginx Mailing List - English
Thanks for the information :) everything is default though so i am not sure what i should even be changing anything to. On the mapped hard drive "Z:/" it has the settings http://i633.photobucket.com/albums/uu52/C0nw0nk/Untitled9.pngby c0nw0nk - Nginx Mailing List - English
Those directives did not fix it. But i decided to investigate sessions and temporary upload directory of PHP. Now the temporary session directory gave me the same no loading issue until uploads have been moved to the mapped hard drive by php. But the following seemed to change that and actualy allow me to keep serving traffic with uploads being pushed to the mapped hard drive. Inside PHP.by c0nw0nk - Nginx Mailing List - English
Hi itpp2012 thanks for the swift response :), I am not proxying to PHP Nginx passes the request to the fastcgi upstream Nginx + PHP are both on the same machine just the storage machine (the mapped hard drive) is seperate. I did look in the docs and find this "fastcgi_buffering off;" And "proxy_buffering off;" http://nginx.org/en/docs/http/ngx_http_fastcgi_module.html#fastcby c0nw0nk - Nginx Mailing List - English
So i have Nginx as a web server with PHP running as fastcgi what nginx serves traffic via upstreams. The strange bug i have encountered is the fact when i upload a large file lets say 2GB and PHP must pass this file to a mapped hard drive via network sharing. PHP/Nginx does not serve traffic to anyone until that temp(uploaded file) has been successfully moved to the mapped hard drive. Does aby c0nw0nk - Nginx Mailing List - English
So i do video streaming of large videos 2GB+ in size how do i know what buffer sizes to use in my nginx config or should i leave it at default ? http://nginx-win.ecsds.eu/ http://nginx.org/en/docs/http/ngx_http_mp4_module.html location ~ \.mp4$ { mp4; #mp4_buffer_size ?; #mp4_max_buffer_size ?; limit_rate_after 2m; limit_rate 1m; expires max; }by c0nw0nk - Nginx Mailing List - English
Also i just saw you added into the latest builds a PHP opcache config file. Check out my post here. http://www.apachelounge.com/viewtopic.php?p=29858#29858 You need to do that to configure Zend Opcache to shares it memory with php-cgi processes and if you use windows set a app pool id.by c0nw0nk - Nginx Mailing List - English
I will leave it at 1 it works fine and i no longer encounter that strange timeout error.by c0nw0nk - Nginx Mailing List - English