title: Actionmailer URL adds subdir twice
body: <p>I have a pretty standard rails 5.1 app which is mounted under a subdir under our main domain:</p>
  
  <p><a href="https://www.company.com/subir/" rel="nofollow noreferrer">https://www.company.com/subir/</a></p>
  
  <p>This is done in routes.rb </p>
  
  <pre><code>scope :subdir 
    the other routes
  end
  </code></pre>
  
  <p>I use NGINX in our DMZ to pass incoming requests to my application server:</p>
  
  <pre><code>...
  server_name www.company.com;
  
   location /subdir {
     proxy_pass https://my-app-server;
   }
  ...
  </code></pre>
  
  <p>on my app-server is the pretty common combo Nginx/Puma installed and almost everything works fine, except the urls which are in the emails I send via actionmailer.</p>
  
  <p>In my view I have a link:</p>
  
  <pre><code>link_to 'approve customer', admin_customer_url(@customer) 
  </code></pre>
  
  <p>This creates the following:</p>
  
  <pre><code>https://www.company.com/**subdir/subdir**/admin/customer/:id
  </code></pre>
  
  <p>On my local machine these links are generated correctly in my emails, but not in staging environment on my app-server.</p>
  
  <p>I dumped the request object in a view to see if my nginx setup is crazy but there is nothing obviously crazy...</p>
  
  <p>Any ideas?</p>