4
0

FreshRSS.Apache.conf 3.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. ServerName freshrss.localhost
  2. Listen 80
  3. DocumentRoot /var/www/FreshRSS/p/
  4. AllowEncodedSlashes On
  5. ServerTokens OS
  6. TraceEnable Off
  7. ErrorLog /dev/stderr
  8. # For logging the original user-agent IP instead of proxy IPs:
  9. <IfModule mod_remoteip.c>
  10. # Can be disabled by setting the TRUSTED_PROXY environment variable to 0:
  11. RemoteIPHeader X-Forwarded-For
  12. # Can be overridden by the TRUSTED_PROXY environment variable:
  13. RemoteIPInternalProxy 10.0.0.1/8 172.16.0.1/12 192.168.0.1/16
  14. </IfModule>
  15. # Default, will be overridden by p/.htaccess and p/api/.htaccess
  16. SetEnvIfExpr "reqenv('LOG_REMOTE_USER') == ''" LOG_REMOTE_USER=-
  17. SetEnvIfExpr "reqenv('LOG_REMOTE_USER') == '-' && reqenv('REMOTE_USER') =~ /(.+)/" LOG_REMOTE_USER=$1
  18. LogFormat "%a %l %{LOG_REMOTE_USER}e %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined_proxy
  19. CustomLog "|/var/www/FreshRSS/cli/sensitive-log.sh" combined_proxy
  20. <IfDefine OIDC_ENABLED>
  21. <IfModule !auth_openidc_module>
  22. Error "The auth_openidc_module is not available. Install it or unset environment variable OIDC_ENABLED."
  23. </IfModule>
  24. # Workaround to be able to check whether an environment variable is set
  25. # See: https://serverfault.com/questions/1022233/using-ifdefine-with-environment-variables/1022234#1022234
  26. Define VStart "${"
  27. Define VEnd "}"
  28. OIDCProviderMetadataURL ${OIDC_PROVIDER_METADATA_URL}
  29. OIDCClientID ${OIDC_CLIENT_ID}
  30. OIDCClientSecret ${OIDC_CLIENT_SECRET}
  31. OIDCSessionInactivityTimeout ${OIDC_SESSION_INACTIVITY_TIMEOUT}
  32. OIDCSessionMaxDuration ${OIDC_SESSION_MAX_DURATION}
  33. OIDCSessionType ${OIDC_SESSION_TYPE}
  34. OIDCRedirectURI /i/oidc/
  35. OIDCDefaultURL ${OIDC_DEFAULT_URL}
  36. OIDCCryptoPassphrase ${OIDC_CLIENT_CRYPTO_KEY}
  37. Define "Test_${OIDC_REMOTE_USER_CLAIM}"
  38. <IfDefine Test_${VStart}OIDC_REMOTE_USER_CLAIM${VEnd}>
  39. OIDCRemoteUserClaim preferred_username
  40. </IfDefine>
  41. <IfDefine !Test_${VStart}OIDC_REMOTE_USER_CLAIM${VEnd}>
  42. OIDCRemoteUserClaim "${OIDC_REMOTE_USER_CLAIM}"
  43. </IfDefine>
  44. Define "Test_${OIDC_SCOPES}"
  45. <IfDefine Test_${VStart}OIDC_SCOPES${VEnd}>
  46. OIDCScope openid
  47. </IfDefine>
  48. <IfDefine !Test_${VStart}OIDC_SCOPES${VEnd}>
  49. OIDCScope "${OIDC_SCOPES}"
  50. </IfDefine>
  51. Define "Test_${OIDC_X_FORWARDED_HEADERS}"
  52. <IfDefine !Test_${VStart}OIDC_X_FORWARDED_HEADERS${VEnd}>
  53. OIDCXForwardedHeaders ${OIDC_X_FORWARDED_HEADERS}
  54. </IfDefine>
  55. # Additional parameters can be set e.g. in /var/www/FreshRSS/p/i/.htaccess
  56. </IfDefine>
  57. <Directory />
  58. AllowOverride None
  59. Options FollowSymLinks
  60. Require all denied
  61. </Directory>
  62. <Directory /var/www/FreshRSS/p>
  63. AllowOverride None
  64. Include /var/www/FreshRSS/p/.htaccess
  65. Options FollowSymLinks
  66. Require all granted
  67. </Directory>
  68. <Directory /var/www/FreshRSS/p/api>
  69. Include /var/www/FreshRSS/p/api/.htaccess
  70. </Directory>
  71. <Directory /var/www/FreshRSS/p/i>
  72. ExpiresActive Off
  73. <IfDefine OIDC_ENABLED>
  74. AuthType openid-connect
  75. Require valid-user
  76. </IfDefine>
  77. IncludeOptional /var/www/FreshRSS/p/i/.htaccess
  78. </Directory>
  79. <Directory /var/www/FreshRSS/p/themes>
  80. Include /var/www/FreshRSS/p/themes/.htaccess
  81. </Directory>