Skip to content

Instantly share code, notes, and snippets.

@zhfish
Last active June 23, 2017 00:01
Show Gist options
  • Save zhfish/c13df1b3ace50bfb1ba34a7db380bbfb to your computer and use it in GitHub Desktop.
Save zhfish/c13df1b3ace50bfb1ba34a7db380bbfb to your computer and use it in GitHub Desktop.

Revisions

  1. zhfish revised this gist Nov 11, 2016. No changes.
  2. zhfish created this gist Nov 11, 2016.
    22 changes: 22 additions & 0 deletions frp.conf
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,22 @@
    #/etc/nginx/conf.d/frp.conf

    server {
    listen 80;
    server_name *.tunnel.frp.com;
    charset utf-8;

    location / {
    proxy_set_header X-Real-IP $remote_addr;
    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_pass http://127.0.0.1:7080;
    }


    client_max_body_size 60M;
    client_body_buffer_size 512k;

    access_log off;
    error_log off;
    }
    16 changes: 16 additions & 0 deletions frp.service
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,16 @@
    #/etc/systemd/system/frp.service

    [Unit]
    Description=frp
    After=network.target

    [Service]
    Type=simple
    PIDFile=/run/frp.pid
    ExecStart=/usr/local/frp/frps -c /usr/local/frp/frps.ini
    ExecReload=/bin/kill -s HUP $MAINPID
    ExecStop=/bin/kill -s QUIT $MAINPID
    Restart=on-failure

    [Install]
    WantedBy=multi-user.target
    13 changes: 13 additions & 0 deletions frpc.ini
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,13 @@
    [common]
    server_addr = 8.8.8.8
    server_port = 7000
    privilege_token = token
    vhost_http_port = 7080

    [a]
    type = http
    local_port = 2564
    privilege_mode = true
    auth_token = a.tunnel.frp.com;
    custom_domains = a.tunnel.frp.com;
    host_header_rewrite = localhost
    7 changes: 7 additions & 0 deletions frps.ini
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,7 @@
    [common]
    bind_addr = 0.0.0.0
    bind_port = 7000
    dashboard_port = 7070
    vhost_http_port = 7080
    privilege_mode = true
    privilege_token = token