Cloudron makes it easy to run web apps like WordPress, Nextcloud, GitLab on your server. Find out more or install now.


    Cloudron Forum

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular

    Solved X-Forwarded-For Header

    Support
    nginx reverseproxy
    4
    7
    358
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • M
      Mastadamus last edited by girish

      I have a NGINX reverse proxy in front of Cloudron due to the fact I have multiple VM's to proxy to and only one Public IP. Everything is working correctly. I am using NGINX proxy manager. I can visit all my Cloudron sites. My only problem is this.. In the NGINX logs on my Cloudron box, it shows the source IP of traffic as the internal IP address of my external NGINX Proxy manager. Nginx proxy manager should be configured for x-forwarded for headers but it seems like the NGINX on the cloudron box isn't using the x-forwarded for header as the source. Do you guys have any idea why or how to fix it?

      1 Reply Last reply Reply Quote 0
      • M
        Mastadamus last edited by

        Nevermind I fixed it by doing the following.

        1. Added this configuration to the HTTP{} section of the nginx.conf file in /etc/nginx/nginx.conf

        log_format main '$http_x_forwarded_for - $remote_user [$time_local] '
        '"$request" $status $body_bytes_sent "$http_referer" '
        '"$http_user_agent"' ;

        access_log /var/log/nginx/access.log main;

        1 Reply Last reply Reply Quote 0
        • M
          Mastadamus last edited by

          Nevermind I fixed it by doing the following.

          1. Added this configuration to the HTTP{} section of the nginx.conf file in /etc/nginx/nginx.conf

          log_format main '$http_x_forwarded_for - $remote_user [$time_local] '
          '"$request" $status $body_bytes_sent "$http_referer" '
          '"$http_user_agent"' ;

          access_log /var/log/nginx/access.log main;

          1 Reply Last reply Reply Quote 0
          • mehdi
            mehdi App Dev last edited by

            @Mastadamus This will probably be lost at each cloudron update, be aware

            1 Reply Last reply Reply Quote 1
            • Topic has been marked as a question  girish girish 
            • Topic has been marked as solved  girish girish 
            • robi
              robi last edited by robi

              @girish should this be added as default for Cloudron?

              Life of Advanced Technology

              girish 1 Reply Last reply Reply Quote 0
              • girish
                girish Staff @robi last edited by

                @robi this is set for app but not for the dashboard itself which OP was trying to fix. I think we have to add it to dashboard's nginx config when we look into supporting reverse proxy setups properly.

                M 1 Reply Last reply Reply Quote 1
                • M
                  Mastadamus @girish last edited by

                  @girish Any update on support reverse proxy or adding this logging config as default?

                  girish 1 Reply Last reply Reply Quote 0
                  • girish
                    girish Staff @Mastadamus last edited by

                    @Mastadamus yes, reverse proxy is implemented in next release (7.3) - https://forum.cloudron.io/topic/6655/what-s-coming-in-7-3/21

                    1 Reply Last reply Reply Quote 0
                    • First post
                      Last post
                    Powered by NodeBB