Welcome to the LimeSurvey Community Forum

Ask the community, share ideas, and connect with other LimeSurvey users!

LimeSurvey behind Caddy as a reverse proxy

  • mariagrimaldi
  • mariagrimaldi's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
9 months 3 weeks ago - 9 months 3 weeks ago #244825 by mariagrimaldi
LimeSurvey behind Caddy as a reverse proxy was created by mariagrimaldi
Please help us help you and fill where relevant:
Your LimeSurvey version:  6.1.0+230522
Own server or LimeSurvey hosting: kubernetes 1.24
Survey theme/template: default
==================

Hi there! I hope you're doing well. I'm currently wondering a few things about configuring LimeSurvey behind Caddy. Here are the details of my hosting setup:

- Caddy (docker.io/caddy:2.6.3) is a web proxy and handles SSL/TLS certificate generation at runtime
- We have the usual setup for kubernetes: services, deployments, and volumes for LimeSurvey
- Here's the Caddyfile we're currently using:
Code:
# Global configuration
{
    # Enable proxying from all servers by default. Otherwise, X-Forwarded-* headers will
    # be overwritten.
    servers {
        trusted_proxies static 0.0.0.0/0 ::/0
    }
}
 
# proxy directive snippet (with logging) to be used as follows:
#
#     import proxy "containername:port"
(proxy) {
    log {
        output stdout
        format filter {
            wrap json
            fields {
                common_log delete
                request>headers delete
                resp_headers delete
                tls delete
            }
        }
    }
 
    # This will compress requests that matches the default criteria set by Caddy.
    # see https://caddyserver.com/docs/caddyfile/directives/encode
    # for information about the defaults; i.e. how/when this will be applied.
    encode gzip
 
    reverse_proxy {args.0} {
        header_up X-Forwarded-Port 443
    }
}
 
limesurvey.subdomain{$default_site_port} {
    import proxy "limesurvey:80"
}
With this configuration, I can access LimeSurvey through the browser without issues. But then I found that LimeSurvey has some specific settings to be configured when working behind a proxy. I referred to the LimeSurvey configuration file config-defaults.php and added the following lines to my
Code:
config.php
file:
Code:
// Use the following config variable to set modified optional settings copied from config-defaults.php
'config' => array(
    ...
    'proxy_host_name' => 'limesurvey.subdomain',
    'proxy_host_port' => 443,
)
My question is: when is this configuration needed?

I would greatly appreciate any guidance or suggestions on properly configuring LimeSurvey behind Caddy as a reverse proxy. Thank you in advance for your assistance!
Last edit: 9 months 3 weeks ago by mariagrimaldi.

Please Log in to join the conversation.

Lime-years ahead

Online-surveys for every purse and purpose