Skip to content

Instantly share code, notes, and snippets.

@ianmurrays
Created October 26, 2011 18:09
Show Gist options
  • Save ianmurrays/1317183 to your computer and use it in GitHub Desktop.
Save ianmurrays/1317183 to your computer and use it in GitHub Desktop.
nginx as apache proxy
NameVirtualHost 127.0.0.1:8080
<VirtualHost 127.0.0.1:8080>
ServerAdmin [email protected]
ServerName domain.example.org
ServerAlias www.domain.example.org
DocumentRoot /path/to/docroot
ErrorLog /path/to/docroot/logs/error.log # Optional
CustomLog /path/to/docroot/logs/access.log combined # Optional
RPAFenable On
RPAFsethostname On
RPAFproxy_ips 127.0.0.1
SuexecUserGroup user group
DirectoryIndex index.php index.html
<Directory /path/to/docroot>
Options FollowSymLinks
AllowOverride All
Order allow,deny
allow from all
</Directory>
</VirtualHost>
server {
listen 80;
server_name domain.example.org;
location / {
access_log off;
proxy_pass http://127.0.0.1:8080;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment