ansible-nginx icon indicating copy to clipboard operation
ansible-nginx copied to clipboard

skip redirect to ssl

Open pniederlag opened this issue 10 years ago • 4 comments

I am using debops and bootstrapped a single node from my local controll machine. I have added some host_vars for a specific host in order to add another nginx config, see code below. The created file for nginx still does redirect to the ssl site. Is there any way to disable this or maybe even another way to add a custom template file? Or, do you suggest to create a separate role? Would that simplify anything?


---
# List of nginx server definitions
nginx_servers: [ '{{ nginx_server_default }}', '{{ nginx_server_super }}']

# additional super nginx server
nginx_server_super:
  enabled: True
  type: 'php5'
  name: ['super.example.com']
  redirect_to_ssl: False

pniederlag avatar Aug 19 '15 16:08 pniederlag

To disable default redirection to HTTPS version of the site, set item.ssl: False in the server configuration:

nginx_server_super:
  enabled: True
  type: 'php5'
  name: ['super.example.com']
  ssl: False

The item.redirect_to_ssl option can be used to generate a redirection from HTTP to HTTPS, but without the HTTPS version of the config added by the template, so that HTTPS version can be generated separately.

drybjed avatar Aug 19 '15 16:08 drybjed

Thx for your pointer. Indeed it works to set xxx.ssl: False, but of course it does really disable SSL. For now I will just try to setup http first and check on the options for ssl later. My Wishlist:

  • keep http and https config in one file
  • have a chance to keep the config for http and https in a way that I can enforce ssl on special (sup-)paths only (typo3/*) ;)

pniederlag avatar Aug 20 '15 16:08 pniederlag

Can you give an example of how that config would look like?

drybjed avatar Aug 20 '15 17:08 drybjed

@pniederlag Does #76 address your issue?

ypid avatar Oct 10 '15 19:10 ypid