Answer the question
In order to leave comments, you need to log in
Setting up nginx(proxy) + apache with url rewrite?
server {
listen 80;
root /var/www/;
index index.php index.html index.htm;
server_name example.com;
location / {
try_files $uri $uri/ /index.php;
}
location ~ \.php$ {
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header Host $host;
proxy_pass http://127.0.0.1:8080;
}
location ~ /\.ht {
deny all;
}
}
Answer the question
In order to leave comments, you need to log in
What can be done to make nginx work in proxy mode without dancing with Apache with a similar configuration?
> But judging by the configuration script, there may be problems when apache rewrite is enabled from .htaccess
No, it won't. location ~ /\.ht in this case prohibits http access to .ht* files. Apache itself will, of course, have access to these files.
For the dumb proxy mode, you will need something like this config - hastebin.com/dexoqotopu.nginx (provided that Apache is listening on the localhost on port 81)
Of course, you need to fill it with all sorts of error_page, access_log/error_log and so on.
SSL is enabled like this:
listen 443 ssl;
ssl_certificate /var/www/certs/domain.ru-bundled.crt;
ssl_certificate_key /var/www/certs/domain.ru.key;
ssl_session_cache shared:SSL:10m;
ssl_session_timeout 10m;
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question