limesurvey icon indicating copy to clipboard operation
limesurvey copied to clipboard

How to use HTTP_LOCATION correctly?

Open jreimone opened this issue 6 years ago • 8 comments

Hi, my URL is supposed to be https://my.server.net/surveys. So my docker-compose config looks like this:

   limesurvey:
      restart: always
      image: crramirez/limesurvey:2.72.3
      links:
        - "mysql:db"
      expose:
        - "80"
      environment:
        - "DISABLE_MYSQL=yes"
        - "HTTP_LOCATION=surveys"
      volumes:
        - "./limesurvey/upload:/app/upload"
        - "./limesurvey/config/config-defaults.php:/app/application/config/config-defaults.php"

But when I request https://my.server.net/surveys in the browser I always get redirected to https://my.server.net/index.php?r=installer. What am I doing wrong?

jreimone avatar Mar 02 '18 10:03 jreimone

Hello,

Check your docker-compose.yml you are using expose instead of ports:

   limesurvey:
      restart: always
      image: crramirez/limesurvey:2.72.3
      links:
        - "mysql:db"
      ports:
        - "80:80"
      environment:
        - "DISABLE_MYSQL=yes"
        - "HTTP_LOCATION=surveys"
      volumes:
        - "./limesurvey/upload:/app/upload"
        - "./limesurvey/config/config-defaults.php:/app/application/config/config-defaults.php"

Probably you have another instance running and it is who is answering you.

crramirez avatar Mar 04 '18 22:03 crramirez

That I use expose and ports is correct. The reason is that I have an nginx container running which acts as a reverse proxy. This container is the only container listening on port 80. Thus, all the other containers must expose their ports "internally", especially the port 80 is already used by the nginx container. The nginx container is also the place where I configured that requests to ../surveys/ are redirected to the limesurvey container. The fact that my request to https://my.server.net/surveys is converted to https://my.server.net/index.php?r=installer is supposed to show that it is somehow rewrittten by the limesurvey instance, right? I mean, the installer is requested in contrast to the request to /surveys. This looks like if somewhere the original request to a subpath of my domain is rewritten to the domain itself.

jreimone avatar Mar 05 '18 06:03 jreimone

Having the exact same issue here - any news so far?

lcnittl avatar Apr 23 '19 17:04 lcnittl

@lcnittl Do you also have an nginx in front of limesurvey?

crramirez avatar Apr 23 '19 17:04 crramirez

Yes, I have two LXC containers: One with nginx functioning as reverse proxy The other one with nginx functioning as webserver that serves limesurvey

Edit: Seems like I am in the wrong repo here - thought this is the LimeSurvey/LimeSurvey one. Was quite excited that I found a report of the same issue ;)

lcnittl avatar Apr 23 '19 17:04 lcnittl

Ok if you send me the whole docker-compose.yml I can install it, make some tests and give you an option.

crramirez avatar Apr 23 '19 17:04 crramirez

I think I will have to file this at LimeSurvey/LimeSurvey - I am not using Docker. Sorry for the confusion. Anyways, it looks like LimeSurvey is rewriting the request as suggested by @jreimone.

lcnittl avatar Apr 23 '19 18:04 lcnittl

Ah, ok. Good you found the solution or at least the path

crramirez avatar Apr 23 '19 18:04 crramirez