Im switching from apache to nginx and im not sure how i would do the following in nginx.
<VirtualHost *:80>
ServerName example.com
ProxyRequests On
Alias /faq /var/www/http
<Directory /var/www/http/>
Options Indexes FollowSymLinks
AllowOverride ALL
Require all granted
</Directory>
ProxyPassMatch ^/faq !
ProxyPass / http://localhost:8080/
ProxyPassReverse / http://localhost:8080/
ErrorLog ${APACHE_LOG_DIR}/http.log
CustomLog ${APACHE_LOG_DIR}/http.log combined
i currently have this but i keep getting a 404 error
server {
listen 80;
server_name example.com;
client_max_body_size 30M;
location / {
proxy_pass http://localhost:8080/;
include /etc/nginx/proxy_params;
}
location /faq/ {
proxy_redirect off;
alias /var/www/http;
index index.php;
if (!-e $request_filename) {
rewrite ^/(.*)$ /index.php?q=$1 last;
}
}
location ~ /faq\.php$ {
fastcgi_split_path_info ^(.+\.php)(/.+)$;
# # NOTE: You should have "cgi.fix_pathinfo = 0;" in php.ini
#
# # With php5-cgi alone:
# fastcgi_pass 127.0.0.1:9000;
# # With php5-fpm:
fastcgi_pass unix:/var/run/php7.0-fpm.sock;
fastcgi_index index.php;
include fastcgi_params;
}
}