frontend-apache.conf 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223
  1. ServerRoot "/usr/local/apache2"
  2. Listen 80
  3. LoadModule mpm_event_module modules/mod_mpm_event.so
  4. LoadModule authn_core_module modules/mod_authn_core.so
  5. LoadModule authz_core_module modules/mod_authz_core.so
  6. LoadModule access_compat_module modules/mod_access_compat.so
  7. LoadModule mime_module modules/mod_mime.so
  8. LoadModule log_config_module modules/mod_log_config.so
  9. LoadModule env_module modules/mod_env.so
  10. #LoadModule expires_module modules/mod_expires.so
  11. LoadModule headers_module modules/mod_headers.so
  12. #LoadModule setenvif_module modules/mod_setenvif.so
  13. #LoadModule remoteip_module modules/mod_remoteip.so
  14. LoadModule proxy_module modules/mod_proxy.so
  15. LoadModule proxy_http_module modules/mod_proxy_http.so
  16. LoadModule unixd_module modules/mod_unixd.so
  17. #LoadModule status_module modules/mod_status.so
  18. #LoadModule autoindex_module modules/mod_autoindex.so
  19. LoadModule dir_module modules/mod_dir.so
  20. LoadModule alias_module modules/mod_alias.so
  21. LoadModule session_module modules/mod_session.so
  22. LoadModule session_crypto_module modules/mod_session_crypto.so
  23. LoadModule session_cookie_module modules/mod_session_cookie.so
  24. LoadModule request_module modules/mod_request.so
  25. LoadModule authz_user_module modules/mod_authz_user.so
  26. LoadModule auth_form_module modules/mod_auth_form.so
  27. LoadModule authn_dbd_module modules/mod_authn_dbd.so
  28. LoadModule dbd_module modules/mod_dbd.so
  29. LoadModule macro_module modules/mod_macro.so
  30. LoadModule rewrite_module modules/mod_rewrite.so
  31. <IfModule unixd_module>
  32. #
  33. # If you wish httpd to run as a different user or group, you must run
  34. # httpd as root initially and it will switch.
  35. #
  36. # User/Group: The name (or #number) of the user/group to run httpd as.
  37. # It is usually good practice to create a dedicated user and group for
  38. # running httpd, as with most system services.
  39. #
  40. User daemon
  41. Group daemon
  42. </IfModule>
  43. ServerAdmin you@example.com
  44. ServerName feedati-fe:80
  45. DBDriver pgsql
  46. DBDParams "host=db dbname=feeds user=apache password=apachepass"
  47. <Macro Auth>
  48. AuthFormLoginRequiredLocation "/login/"
  49. # authn
  50. AuthFormProvider dbd
  51. AuthDBDUserPWQuery "SELECT password FROM users.users WHERE username = %s"
  52. # form
  53. AuthType form
  54. AuthName "authenticationform"
  55. # mod_session
  56. Session On
  57. SessionCookieName session path=/;httponly
  58. SessionCryptoPassphrase changeme!really!
  59. </Macro>
  60. <Location "/login/do">
  61. SetHandler form-login-handler
  62. Use Auth
  63. AuthFormLoginSuccessLocation "/panel/"
  64. </Location>
  65. <Directory />
  66. AllowOverride none
  67. Require all denied
  68. </Directory>
  69. DocumentRoot "/var/www"
  70. <Directory "/var/www">
  71. Options None
  72. AllowOverride None
  73. Use Auth
  74. Require all granted
  75. </Directory>
  76. <Files ".ht*">
  77. Require all denied
  78. </Files>
  79. # ErrorLog: The location of the error log file.
  80. # If you do not specify an ErrorLog directive within a <VirtualHost>
  81. # container, error messages relating to that virtual host will be
  82. # logged here. If you *do* define an error logfile for a <VirtualHost>
  83. # container, that host's errors will be logged there and not here.
  84. #
  85. ErrorLog /proc/self/fd/2
  86. # LogLevel: Control the number of messages logged to the error_log.
  87. # Possible values include: debug, info, notice, warn, error, crit,
  88. # alert, emerg.
  89. LogLevel warn
  90. <IfModule log_config_module>
  91. #
  92. # The following directives define some format nicknames for use with
  93. # a CustomLog directive (see below).
  94. #
  95. LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
  96. LogFormat "%h %l %u %t \"%r\" %>s %b" common
  97. <IfModule logio_module>
  98. # You need to enable mod_logio.c to use %I and %O
  99. LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" %I %O" combinedio
  100. </IfModule>
  101. #
  102. # The location and format of the access logfile (Common Logfile Format).
  103. # If you do not define any access logfiles within a <VirtualHost>
  104. # container, they will be logged here. Contrariwise, if you *do*
  105. # define per-<VirtualHost> access logfiles, transactions will be
  106. # logged therein and *not* in this file.
  107. #
  108. CustomLog /proc/self/fd/1 common
  109. #
  110. # If you prefer a logfile with access, agent, and referer information
  111. # (Combined Logfile Format) you can use the following directive.
  112. #
  113. #CustomLog "logs/access_log" combined
  114. </IfModule>
  115. <IfModule headers_module>
  116. #
  117. # Avoid passing HTTP_PROXY environment to CGI's on this or any proxied
  118. # backend servers which have lingering "httpoxy" defects.
  119. # 'Proxy' request header is undefined by the IETF, not listed by IANA
  120. #
  121. RequestHeader unset Proxy early
  122. </IfModule>
  123. <IfModule mime_module>
  124. #
  125. # TypesConfig points to the file containing the list of mappings from
  126. # filename extension to MIME-type.
  127. #
  128. TypesConfig conf/mime.types
  129. #
  130. # AddType allows you to add to or override the MIME configuration
  131. # file specified in TypesConfig for specific file types.
  132. #
  133. #AddType application/x-gzip .tgz
  134. #
  135. # AddEncoding allows you to have certain browsers uncompress
  136. # information on the fly. Note: Not all browsers support this.
  137. #
  138. #AddEncoding x-compress .Z
  139. #AddEncoding x-gzip .gz .tgz
  140. #
  141. # If the AddEncoding directives above are commented-out, then you
  142. # probably should define those extensions to indicate media types:
  143. #
  144. AddType application/x-compress .Z
  145. AddType application/x-gzip .gz .tgz
  146. #
  147. # AddHandler allows you to map certain file extensions to "handlers":
  148. # actions unrelated to filetype. These can be either built into the server
  149. # or added with the Action directive (see below)
  150. #
  151. # To use CGI scripts outside of ScriptAliased directories:
  152. # (You will also need to add "ExecCGI" to the "Options" directive.)
  153. #
  154. #AddHandler cgi-script .cgi
  155. # For type maps (negotiated resources):
  156. #AddHandler type-map var
  157. #
  158. # Filters allow you to process content before it is sent to the client.
  159. #
  160. # To parse .shtml files for server-side includes (SSI):
  161. # (You will also need to add "Includes" to the "Options" directive.)
  162. #
  163. #AddType text/html .shtml
  164. #AddOutputFilter INCLUDES .shtml
  165. </IfModule>
  166. Redirect permanent "/tt-rss" "/tt-rss/"
  167. ProxyPreserveHost On
  168. <Location /tt-rss/>
  169. ProxyPass http://tt-rss/tt-rss/
  170. ProxyPassReverse http://tt-rss/tt-rss/
  171. Use Auth
  172. Require valid-user
  173. RewriteEngine on
  174. RewriteRule .* - [E=RU:%{LA-U:REMOTE_USER},NS]
  175. RequestHeader set X-Forwarded-User %{RU}e
  176. </Location>
  177. Redirect permanent "/rss-bridge" "/rss-bridge/"
  178. <Location /rss-bridge/>
  179. ProxyPass http://rss-bridge/
  180. ProxyPassReverse http://rss-bridge/
  181. Require all granted
  182. </Location>
  183. <Location /panel/>
  184. ProxyPass http://panel:8000/panel/
  185. ProxyPassReverse http://panel:8000/panel/
  186. Use Auth
  187. Require valid-user
  188. RewriteEngine on
  189. RewriteRule .* - [E=RU:%{LA-U:REMOTE_USER},NS]
  190. RequestHeader set X-Forwarded-User %{RU}e
  191. </Location>
  192. # vim: set ft=apache bkc=yes: