setting Nginx Proxy for enable htaccess webuzo

- Posted in Nginx by

setting Nginx Proxy for enable htaccess

vim /usr/local/apps/apache/etc/httpd.conf

ganti Listen 80 to 81

vim /usr/local/apps/apache/etc/conf.d/webuzoVH.conf

nginx

NameVirtualHost 127.0.0.1:80

tambahkan apache

NameVirtualHost 127.0.0.1:81


vim /usr/local/apps/nginx/etc/conf.d/common

Hapus semua file didalam “common” ganti dengan yg ini : kalau bisa tidak di hapus gak usah

# Redirect server error pages to the static pages
error_page 500 502 504 /500.html;
location = /500.html {
root /usr/local/apps/nginx/etc/conf.d;
internal;
}

error_page 404 /404.html;
location = /404.html {
root /usr/local/apps/nginx/etc/conf.d;
internal;
}

error_page 497 /497.html;
location = /497.html {
root /usr/local/apps/nginx/etc/conf.d;
internal;
}

error_page 555 /555.html;
location = /555.html {
root /usr/local/apps/nginx/etc/conf.d;
internal;
}

location @maintenance {
root /usr/local/apps/nginx/etc/conf.d;
rewrite ^(.*)$ /noindex.html break;
}

location / {
try_files $uri $uri/ /index.php;
}
location ~ \.php$ {

proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass http://127.0.0.1:81;
}
location = / {

proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass http://127.0.0.1:81;
}

# For userdir files
location ~* ^/~(.+?)(/.*\.php)$ {

proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass http://127.0.0.1:81;
}

# For userdir files
location ~ ^/~(.+?)(/.*)?$ {

proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass http://127.0.0.1:81;
}

# To catch index.php by default
location ~ (index.php|/)$ {

proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass http://127.0.0.1:81;
}

location ~ \.pl|cgi$ {

proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass http://127.0.0.1:81;
}

restart apache

service httpd restart

restart nginx

service nginx restart