Skip to content

Instantly share code, notes, and snippets.

@phlinhng
Last active July 5, 2020 00:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save phlinhng/227c638803b35bad9ff93b2ad285f315 to your computer and use it in GitHub Desktop.
Save phlinhng/227c638803b35bad9ff93b2ad285f315 to your computer and use it in GitHub Desktop.
v2board + nginx (path: /etc/nginx/sites-enabled/v2board.conf)
server {
listen 80;
listen [::]:80;
root /var/www/v2board/public; # 改成你自己的路径
index index.php index.html;
server_name sspanel.host; # 改成你自己的域名
location / {
try_files $uri $uri/ /index.php$is_args$query_string;
}
location ~ .*\.(js|css)?$ {
expires 1h;
error_log off;
access_log /dev/null;
}
location ~ \.php$ {
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/run/php/php7.4-fpm.sock;
}
}
server {
listen 80;
listen [::]:80;
server_name mydomain.com www.mydomain.com;
return 301 https://mydomain.com$request_uri;
}
server {
listen 443 ssl;
listen [::]:443 ssl;
server_name sspanel.host; # 改成你自己的域名
ssl_certificate /etc/ssl/mydomain.com/cert.pem;
ssl_certificate_key /etc/ssl/mydomain.com/key.pem;
ssl_protocols TLSv1.2 TLSv1.3;
root /var/www/v2board/public; # 改成你自己的路径
index index.php index.html;
location / {
try_files $uri $uri/ /index.php$is_args$query_string;
}
location ~ .*\.(js|css)?$ {
expires 1h;
error_log off;
access_log /dev/null;
}
location ~ \.php$ {
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/run/php/php7.4-fpm.sock;
}
}

create database

mysql -u root -p
mysql>CREATE DATABASE sspanel;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment