You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
gserver/config_example.yaml

130 lines
3.6 KiB
YAML

# vim: set ft=yaml:
# when provide certficate file, server will listen https and enable http2
# http config
-
# listen address
host: 0.0.0.0
# listen port
port: 9001
# default document root
docroot: /srv/www
enableproxy: false
# default host's url rule
#urlrules:
# -
# urlprefix: /a
# type: alias
# target:
# type: dir
# path: /home/user1/a
# -
# urlprefix: /b/a.txt
# type: alias
# target:
# type: file
# path: /home/user1/a/b/a.txt
# virtual host config
vhost:
- &example1_www
hostname: www.example1.com
docroot: /var/www/html/
# cert:
# key:
# url rule for www.example.com
urlrules:
-
# url start with /APIv1/ forward to uwsg socket
urlprefix: /APIv1/
type: uwsgi
target:
type: unix
path: /run/uwsgi/APIv1.sock
-
# route php script to fastCGI socket
urlprefix: /phpmyadmin/.*\.php$
# set to true means urlprefix is regex expression
isregex: true
type: fastcgi
target:
type: unix
path: /var/run/php-fpm/www.sock
-
# url start with /proxy/ forward to http://10.10.1.1
# this act as reverse proxy
urlprefix: /proxy/
type: http
target:
type: http
host: 10.10.1.1
port: 8080
- &example1
<<: *example1_www
hostname: example1.com
- &example_www
hostname: www.example.com
docroot: /var/www/example
urlrules:
-
urlprefix: /APIv2
type: uwsgi
target:
type: unix
path: /run/uwsgi/APIv2.sock
- &example
<<: *example_www
hostname: example.com
- &example_bbs
hostname: bbs.example.com
docroot: /var/www/example_bbs/
urlrules:
-
#urlprefix: \.php$|\.php\/.*
#isregex: true
urlprefix: /
type: fastcgi
target:
type: unix
path: /var/run/php-fpm/www.sock
# https config
-
host: 0.0.0.0
port: 9002
docroot: /srv/www
enableproxy: false
vhost:
-
<<: *example1
cert: /home/user1/cert/example1.com.crt
key: /home/user1/cert/example1.com.key
-
<<: *example1_www
cert: /home/user1/cert/example1.com.crt
key: /home/user1/cert/example1.com.key
-
<<: *example_www
cert: /etc/letsencrypt/live/example.com/fullchain.pem
key: /etc/letsencrypt/live/example.com/privkey.pem
-
<<: *example
cert: /etc/letsencrypt/live/example.com/fullchain.pem
key: /etc/letsencrypt/live/example.com/privkey.pem
-
<<: *example_bbs
cert: /etc/letsencrypt/live/bbs.example.com/fullchain.pem
key: /etc/letsencrypt/live/bbs.example.com/privkey.pem