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

Not working with base #42

Open
fieu opened this issue Jul 14, 2019 · 0 comments
Open

Not working with base #42

fieu opened this issue Jul 14, 2019 · 0 comments

Comments

@fieu
Copy link
Contributor

fieu commented Jul 14, 2019

Problem: Redirects to https://example.com//

Files:

~/.config/andesite/config.json

{
    "root": "/var/www/[REDACTED]/public/private",
    "base": "/private/",
    "port": 8021,
    "auth": "discord",
    "discord": {
        "id": "[REDACTED]",
        "secret": "[REDACTED]"
    }
}

/etc/nginx/sites-available/[REDACTED].conf

server {
        listen 443 ssl http2;
        listen [::]:443 ssl http2;

        server_name [REDACTED];
        root /var/www/[REDACTED]/public;

        # SSL
        ssl_certificate /etc/letsencrypt/live/[REDACTED]/fullchain.pem;
        ssl_certificate_key /etc/letsencrypt/live/[REDACTED]/privkey.pem;
        ssl_trusted_certificate /etc/letsencrypt/live/[REDACTED]/chain.pem;

        # logging
        access_log /var/log/nginx/[REDACTED].access.log;
        error_log /var/log/nginx/[REDACTED].error.log warn;

        # index.php
        index index.php;

        # index.php fallback
        location / {
                try_files $uri $uri/ /index.php?$query_string;
        }

        # handle .php
        location ~ \.php$ {
                include nginxconfig.io/php_fastcgi.conf;
        }

        location /private/ {
                proxy_pass http://localhost:8021/;
                proxy_set_header Host $host;
        }

        include nginxconfig.io/general.conf;
}

# subdomains redirect
server {
        listen 443 ssl http2;
        listen [::]:443 ssl http2;

        server_name *.[REDACTED];

        # SSL
        ssl_certificate /etc/letsencrypt/live/[REDACTED]/fullchain.pem;
        ssl_certificate_key /etc/letsencrypt/live/[REDACTED]/privkey.pem;
        ssl_trusted_certificate /etc/letsencrypt/live/[REDACTED]/chain.pem;

        return 301 https://[REDACTED]$request_uri;
}

# HTTP redirect
server {
        listen 80;
        listen [::]:80;

        server_name .[REDACTED];

        include nginxconfig.io/letsencrypt.conf;

        location / {
                return 301 https://[REDACTED]$request_uri;
        }
}
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

1 participant