Apache orden de preferencias
============================
Ver orden en que usa los VirtualHosts
``` apache2ctl -S ```
Orden de preferencias para directivas de config en Apache
---------------------------------------------------------
- Alias/Redirect - First match wins
- RewriteRule - Last match wins
In addition:
- Redirect over Alias
- Alias before Directory container
- Location containers run once before Alias, so Location will apply
ProxyPass
---------
- The configured ProxyPass and ProxyPassMatch rules are checked in the order of configuration.
- The first rule that matches wins.
- So usually you should sort conflicting ProxyPass rules starting with the longest URLs first.
Rewrite y ProxyPass
-------------------
- ProxyPass takes precedence before mod_rewrite and mod_alias
O rewrite en bloque Proxy
```
Redirect permanent /broken/page.html https://www.example.com/correct/page.html
RedirectMatch ^/deadstuff.+ http://www.example.com/correct/page.html
ProxyPass / http://127.0.0.1:8090/ connectiontimeout=300 timeout=300
ProxyPassReverse / http://127.0.0.1:8090
```
- Regarding ProxyPass "working in the other direction", this is only true if they're outside of a . Inside a , the rules of merging are followed, meaning you want your least-specific directives to come before the more specific ones. This allows the more specific ones to override the less specific directives.
Location y LocationMatch
------------------------
Inside a , the rules of merging are followed, meaning you want your least-specific directives to come before the more specific ones. This allows the more specific ones to override the less specific directives.