Skip to content
This repository has been archived by the owner on Feb 9, 2023. It is now read-only.

how to config nginx to proxy prpl-server? #50

Closed
Gaubee opened this issue Sep 28, 2017 · 1 comment
Closed

how to config nginx to proxy prpl-server? #50

Gaubee opened this issue Sep 28, 2017 · 1 comment

Comments

@Gaubee
Copy link

Gaubee commented Sep 28, 2017

I need a .conf template file. some body help please.
(づ。◕‿‿◕。)づ

@Gaubee Gaubee changed the title who to config nginx to proxy prpl-server? how to config nginx to proxy prpl-server? Sep 28, 2017
@Gaubee
Copy link
Author

Gaubee commented Sep 30, 2017

I use prpl-server-node and Certbot .
this is my config, work for me :

server{
        listen          80;
        index           index.html;
        server_name     gaubee.com;

    listen 443 ssl; # managed by Certbot
ssl_certificate /etc/letsencrypt/live/gaubee.com/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/gaubee.com/privkey.pem; # managed by Certbot
    include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot


    if ($scheme != "https") {
        return 301 https://$host$request_uri;
    } # managed by Certbot

    location / {
        proxy_pass http://127.0.0.1:8080/;
        proxy_set_header X-Forwarded-Proto $scheme;
#        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Host $host:$server_port;
        proxy_set_header X-Forwarded-Server $host;
        proxy_read_timeout 3m;
        proxy_send_timeout 3m;
        proxy_buffer_size  128k;
        proxy_buffers   32 32k;
        proxy_busy_buffers_size 128k;
    }
}

the buffer size must be large enough, because http/2 push will write preload file list in headers.

@Gaubee Gaubee closed this as completed Sep 30, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant