Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

access log inside rewrite_www_to_non_www and rewrite_non_www_to_www #1545

Closed
m1keru opened this issue Apr 6, 2023 · 3 comments · Fixed by #1546
Closed

access log inside rewrite_www_to_non_www and rewrite_non_www_to_www #1545

m1keru opened this issue Apr 6, 2023 · 3 comments · Fixed by #1546
Labels
enhancement New feature or request skip-changelog

Comments

@m1keru
Copy link
Contributor

m1keru commented Apr 6, 2023

Affected Puppet, Ruby, OS and module versions/distributions

  • Puppet: 7.9.5-1
  • Ruby: 3.0.4p208
  • Distribution: Debian 10
  • Module version: 4.3.0

How to reproduce (e.g Puppet code you use)

Hiera example.

nginx::nginx_servers:
  site:
    server_name:
      - site.com
    ssl: true
    ssl_redirect: true
    rewrite_www_to_non_www: true
...

What are you seeing

Resulting block at the host:

# MANAGED BY PUPPET
server {
  listen       *:443 ssl http2;

  server_name  www.site.com;
  return       301 https://site.com$request_uri;
 ...
}

All access and error logs fall into access.log and error.log instead of [ssl-]site.access.log and [ssl-]site.error.log.

What behaviour did you expect instead

It would be great to have access log and error log like in regular sections:

# MANAGED BY PUPPET
server {
  listen       *:443 ssl http2;

  server_name  www.site.com;
  return       301 https://site.com$request_uri;
  ...
  access_log            /var/log/nginx/ssl-site.access.log full;
  error_log             /var/log/nginx/ssl-site.error.log;
}
  

Output log

tail  -n 2 /var/log/nginx/access.log 

www.site.com XX.XX.XX.XX - - [06/Apr/2023:08:18:17 +0000] "GET / HTTP/1.1" 301 162 "-" "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:29.0) Gecko/20120101 Firefox/29.0" 0.000 - "-" - 141 0 0 140 - 367 7b38996869bdc339-EWR -
www.site.com XX.XX.XX.XX - - [06/Apr/2023:08:18:50 +0000] "GET /app-ads.txt HTTP/2.0" 301 162 "-" "Dalvik/2.1.0 (Linux; U; Android 11; SM-G973F Build/RP1A.200720.012)" 0.000 - "-" - 138 0 0 137 - 236 7b389a368e379930-YYZ TLSv1.3

Any additional information you'd like to impart

@m1keru
Copy link
Contributor Author

m1keru commented Apr 24, 2023

Bump

1 similar comment
@1pintbeer
Copy link

Bump

@m1keru
Copy link
Contributor Author

m1keru commented Jun 21, 2023

Is anybody alive here?

@kenyon kenyon added the enhancement New feature or request label Jun 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request skip-changelog
Projects
None yet
4 participants