Welcome! Log In Create A New Profile

Advanced

cgi proxy

Posted by eaonflux 
cgi proxy
July 01, 2009 03:17AM
HI,

i am running a vps with multiple vhosts (4 to be excact) and installed fastcgi for php and perl

but somehow the perl cgi doesnt work how it should http://free-proxy.nl/cgi-bin/nph-proxy.cgi

it shows the proxy but it doesnt handle the query's?

example:

start url = http://free-proxy.nl/cgi-bin/nph-proxy.cgi
query example = http://free-proxy.nl/cgi-bin/nph-proxy.cgi/111110A/x-proxy/cookies/manage

this doesnt work? neither on free-proxy or adult-links.info/cgi-bin/nph-proxy.cgi
strange part is that the error files i declare in the sites-avaible are never filled with any data.
so i have no cleu whats going wrong
error_log /home/public_html/free-proxy.nl/log/error.log;

anyone know what i'm doing wrong?

grts,

chris

////////free-proxy.nl
server {
listen 80;
server_name www.free-proxy.nl;
rewrite ^/(.*) http://free-proxy.nl/$1 permanent;
}

server {
listen 80;
server_name free-proxy.nl;
access_log /home/public_html/free-proxy.nl/log/access.log;
error_log /home/public_html/free-proxy.nl/log/error.log;
error_page 400 /index.php?400;
error_page 401 /index.php?401;
error_page 403 /index.php?403;
error_page 404 /index.php?404;
error_page 500 /index.php?500;
location / {
root /home/public_html/free-proxy.nl/public/;
index plus.php index.php index.html;
# Wordpress permalinks.
include /usr/local/nginx/conf/free-proxy_params.regular;
}

# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
location ~ \.php$
{
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
include /usr/local/nginx/conf/fastcgi_params;
fastcgi_param SCRIPT_FILENAME /home/public_html/free-proxy.nl/public$fastcgi_script_name;
}

# /cgi-bin configuration
location ~ ^/cgi-bin/.*\.cgi$ {
gzip off;
error_log /home/public_html/free-proxy.nl/log/error.log;
fastcgi_pass unix:/var/run/nginx/perl_cgi-dispatch.sock;
fastcgi_param SCRIPT_FILENAME /home/public_html/free-proxy.nl/public$fastcgi_script_name;
fastcgi_index index.cgi;
fastcgi_read_timeout 5m;
include /usr/local/nginx/conf/fastcgi_params;
}
location ~ /\.ht {
deny all;
}
}
Re: cgi proxy
July 01, 2009 11:32AM
When you say "it doesn't work" what are you actually seeing? Is there an error message? I see a "nothing found" message but then I had no cookies to clear. I was able to navigate to a site via the proxy though your adserver promptly navigated me away from that page and to another, and if I hit the "back" button I was re-directed again - to me this is a bigger problem than not being able to clear cookies. I can do that manually.

--
Jim Ohlstein
Re: cgi proxy
July 01, 2009 01:26PM
lol, i gave that as an explanation, ofcourse the redirection is even bugging me more.
but i am guessing when i solve the cookie query prob the other redirection probs will vanish to.
i think they are related.
but what i ment is, what for url i put in the submit form of that (perl) cgi proxy i get redirected to the frontpage.
but if you look at the url of the cookies (besides that i dont want to see my cookies, but you should see another page)
it redirects me also to the front page, so the perl module in nginx is working but has (maybe, could also be an misconfiguration from me) probs with the query's.

query is: 111110A/x-proxy/start
org link: http://free-proxy.nl/cgi-bin/nph-proxy.cgi/111110A/x-proxy/start
normaly you see them as ?blah&or=blah&and-so-on
cus if you look at the orginal link:
Here's a demo http://www.jmarshall.com/tools/cgiproxy/ (username "free", password "speech"),
you see its not the scripts thats faulty.

its just somehow when you feed the script a query i get redirected back to the frontpage?

and the only error message i see is on mine own front page "Nothing found."

sorry i hope you understand what i mean, not so good in explaining in english.

grts,

chris



Edited 1 time(s). Last edit at 07/01/2009 01:29PM by eaonflux.
Re: cgi proxy
July 01, 2009 01:33PM
this part are specific for mine bookmark page:
root /home/public_html/free-proxy.nl/public/;
index plus.php index.php index.html;
------------------------------------------------------------------

this is mine /usr/local/nginx/conf/free-proxy_params.regular file.
# Wordpress permalinks.

if ($request_uri ~* "^/index.php\??$") {
rewrite ^.*$ http://$host? permanent;
}

# WordPress pretty URLs: (as per dominiek.com)
if (-f $request_filename) {
break;
}
if (-d $request_filename) {
break;
}
rewrite . /plus.php last;

---------------------------------------------------
this is how it was in apache

DirectoryIndex plus.php index.php index.htm index.html

RewriteEngine on
RewriteBase /
RewriteCond %{HTTP_HOST} !^free-proxy\.nl [NC]
RewriteRule ^(.*)$ http://free-proxy\.nl/$1 [L,R=301]

ErrorDocument 400 /index.php?400
ErrorDocument 401 /index.php?401
ErrorDocument 403 /index.php?403
ErrorDocument 404 /index.php?404
ErrorDocument 500 /index.php?500

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . plus.php [L]
Re: cgi proxy
July 01, 2009 04:21PM
I'm fairly familiar with CGIProxy though not with your wrapper script. I run several sites with a fairly "vanilla" installation using fcgiwrap from Grzegorz Nosek and unix sockets. I'm guessing the issue is with your wrapper and its rewrites as the default CGIProxy (2.1 beta19 if I recall correctly) works pretty much out of the box with a simple configuration and no rewrites. I'm hardly a regex expert but you have a double question mark and only one is escaped. Could that be an issue?

For your WordPress installation, if you are using a later 0.7.x series nginx or 0.8.x they support the "try_files" directive which is much more efficient than are the if statements, so you may try using:

[code]
location /path/to/wordpress {
try_files $uri $uri/ /plus.php;
}
[/code]

That tests if the requested URI is a file and if it is, serves it, then tests if it is a directory, and if it is, serves the index file, and if neither passes the request to /plus.php.

--
Jim Ohlstein
Re: cgi proxy
July 02, 2009 01:50AM
ah you mean this:
if ($request_uri ~* "^/index.php\??$") {
rewrite ^.*$ http://$host? permanent;
}
i blanked it out just to check if this is the problem but it aint, still getting the same.

this is a piece of code that redirects all index.php to the mainfrontpage url.

(you probally know that, just in case)

i still use 0.6.35 i had probs with the 8version.
i compiled the 8 v (0.6.35 also) no errors (with ssl,flv and perl support) but some how it doesnt take the old settings i made and to solve this adhoc on a production server.
i tried but after 5 minutes offline with 4 domains i changed it back to 0.6.35 and came to conclusion i must test it 8version on mine dev server.

p.s. its not Wordpress, sorry for the confusion, i was to lazy the delete that line.
Re: cgi proxy
July 02, 2009 03:01AM
wel i just compiled the 0.8.4 made a deb package from it also with mine old version, so i can always reinstall the old one quick.

but i did install and compile it properly, so all is working except that query prob.

but i am abit puzzled

this piece of code:
location /path/to/wordpress {
try_files $uri $uri/ /plus.php;
}

should i replace it with this (*the one in bold)?
location / {
[b] root /home/public_html/free-proxy.nl/public/;
index plus.php index.php index.html;[/b]
# Wordpress permalinks.
include /usr/local/nginx/conf/free-proxy_params.regular;
}

i tried this (i use includes like /usr/local/nginx/sites-available/free-proxy.nl) :

location / {
root /home/public_html/free-proxy.nl/public/;
#index plus.php index.php index.html;
try_files $uri $uri/ /plus.php;
# Wordpress permalinks.
include /usr/local/nginx/conf/free-proxy_params.regular;
}
Re: cgi proxy
July 02, 2009 03:06AM
mine new conf file goes like this:
user www-data;
worker_processes 4;

error_log logs/error.log;
#error_log logs/error.log notice;
#error_log logs/error.log info;

pid logs/nginx.pid;


events {
worker_connections 1024;
}


http {
include mime.types;
default_type application/octet-stream;

log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';

access_log logs/access.log main;

sendfile on;
#tcp_nopush on;

#keepalive_timeout 0;
keepalive_timeout 65;

#gzip on;
include /usr/local/nginx/sites-enabled/*;
}

the try statement i filled in /usr/local/nginx/sites-enabled/free-proxy.nl
need to do some more reading
Re: cgi proxy
July 02, 2009 03:44AM
uhm, i must say that the bookmark and the cgi proxy are 2 diff programs.

is still get redirected to the fronpage (in real its the plus.php)
i dont get it.

sorry
Re: cgi proxy
July 02, 2009 04:58AM
its the / that gives me the prob.

example: http://free-proxy.nl/cgi-bin/nph-proxy.cgi/
Re: cgi proxy
July 03, 2009 02:55AM
crap i noticed that all other apps dont work with the / behind the url

like http://free-proxy.nl/proxy/proxy2/browse.php/Oi8vc2FkYXM_3D/b13/fnorefer/
doesnt work?

only the one that are declared at the root of free-proxy.nl are working.

like:

http://free-proxy.nl/Hotmarks/

this works.

i am using a cms around 3 proxies

2 aint working cus they use the / as query delimiter (dunno if its called like this)
but the one thats working has the old style queries like:

http://free-proxy.nl/proxy/proxy1/index.php?q=aHR0cDovL29ubGluZXdlYmdhbWVzLnR1bWJsci5jb20v&hl=24e

you see no /

the try_files i replaced with the old if statements excatly where the where in the include parameter file in, but then mine whole css theme is messed up and it still aint working.

i really dont know what causing this.

well i will tincker around till the end of the week for this otherwise i am getting back to apache.
this cost me to much time, i have more then 10 servers running with this prob.

probally i am to stupid for nginx .. blah .. mine luck

well one thing i know for sure this isnt a perl prob. lol

grts,

chris
Re: cgi proxy
July 03, 2009 03:10AM
ah i see when i only insert the try_files $uri $uri/ /plus.php;
in mine parameter file then it works like to old statements.

ok we getting somewhere ;)

but still got the / probs

before i entered the whole string:

location /path/to/wordpress {
try_files $uri $uri/ /plus.php;
}

that messed up mine css theme.

i am guessing i need a rule to lift that / prob
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 107
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 500 on July 15, 2024
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready