Skip to content

Instantly share code, notes, and snippets.

@rudyryk
Last active March 5, 2020 11:42
Show Gist options
  • Save rudyryk/ce2e8d8bec0f5d12aac70d21746beb1b to your computer and use it in GitHub Desktop.
Save rudyryk/ce2e8d8bec0f5d12aac70d21746beb1b to your computer and use it in GitHub Desktop.
# Nginx initial proxy config for Pgweb
server {
listen 80;
client_max_body_size 8m;
server_name pgweb.domain.com;
keepalive_timeout 5;
root /var/www/pgweb;
location / {
try_files $uri @application;
}
location @application {
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header Host $http_host;
proxy_redirect off;
proxy_pass http://127.0.0.1:8432;
}
}
#!/bin/sh
# Install Pgweb
cd /usr/local/sbin
wget https://github.com/sosedoff/pgweb/releases/download/v0.9.2/pgweb_linux_amd64
chmod +x pgweb_linux_amd64
mv pgweb_linux_amd64 pgweb
# Prepare for serving static to web
mkdir /var/www/pgweb
; 1. Put under /etc/systemd/system/pgweb.service
; 2. Enable service:
; systemctl enable pgweb
; 3. Start service:
; systemctl start pgweb
[Unit]
Description=Pgweb server
[Service]
Environment=LANG=en_US.UTF-8
ExecStart=/usr/local/sbin/pgweb --bind=127.0.0.1 --listen=8432
[Install]
WantedBy=multi-user.target
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment