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

expires.conf will break upstream #132

Closed
bmarwell opened this issue Mar 2, 2016 · 1 comment
Closed

expires.conf will break upstream #132

bmarwell opened this issue Mar 2, 2016 · 1 comment

Comments

@bmarwell
Copy link

bmarwell commented Mar 2, 2016

Hello,

I tried to use the boilerplate with guacamole.
I defined upstream as this:

upstream guac {
      server 127.0.0.1:8080;
}
server {
    listen                  443 ssl http2;
    server_name             guac.example.invalid;

    include h5bp/directive-only/ssl.conf;
    include h5bp/directive-only/ssl-stapling.conf;

    # ssl stuff

    rewrite_log on;
    error_log /var/log/nginx/guac.error.log notice;
    access_log /var/log/nginx/guac.access.log main;

    location / {
        access_log              off;
        proxy_pass              http://guac;
        proxy_set_header        Upgrade $http_upgrade;
        proxy_set_header        X-Real-IP $remote_addr;
        proxy_set_header        Connection "upgrade";
        proxy_set_header        Proxy-Connection "Keep-Alive";
        proxy_set_header        X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header        Host $http_host;

        proxy_buffering         off;
        proxy_set_header        X-Forwarded-Proto  $scheme;
        proxy_set_header        X-NginX-Proxy  true;
        proxy_http_version 1.1;
    }

    # Include the basic h5bp config set
    #include h5bp/basic.conf;
}

However; if I enable the basic.conf, the expires.conf will break guacamole. Because the ~.css|js|jpg etc rules are more specific, they will never be passed to upstream.

Also, this will not work with try_files $uri @proxy;.

As the .js files are generated and not directly inside the guacamole .war file, I cannot set a static root.

This means, the basic.conf will break any upstream where those files aren't served locally.

@AD7six
Copy link
Member

AD7six commented Mar 24, 2016

This is a general problem with how nginx resolves location directies - there's no inheritance for most directives, and there's only ever one location block match. Unfortunately that means the files in this repo that use location directives are not directly usable in many scenarios the one in the issue description being one of them.

See https://github.com/h5bp/server-configs-nginx/blob/master/doc/common-problems.md#only-some-rules-are-being-applied for more information.

@AD7six AD7six closed this as completed Mar 24, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants