How to write ScriptAlias in nginx.conf like in httpd.conf

Francis Daly francis at daoine.org
Wed Aug 8 23:08:15 UTC 2012


On Thu, Aug 09, 2012 at 12:55:58AM +0200, Swapnil P. wrote:

Hi there,

> I have to configure nginx.conf just like the httpd.conf and stuck while
> configuring ScriptAlias. I have
> 
> ScriptAlias /cgi-bin/ "/var/www/cgi-bin/"
> 
> i want to write the above in nginx.conf. How can I write it?

  location /cgi-bin/ {
    proxy_pass http://apache_server:apache_port
  }

(ScriptAlias in apache httpd is for configuring CGI handling. nginx
doesn't handle CGI, so you need to decide how you want the urls to be
handled. This version just proxies them to your running apache.)

Depending on the rest of your nginx.conf, you may want " ^~" after
"location".

http://nginx.org/r/location
http://nginx.org/r/proxy_pass

	f
-- 
Francis Daly        francis at daoine.org



More information about the nginx mailing list