Browse Source

add nginx.conf crontab

joe 3 years ago
parent
commit
4bcc7ae429
2 changed files with 48 additions and 0 deletions
  1. 4 0
      docs/crontab
  2. 44 0
      docs/nginx.conf

+ 4 - 0
docs/crontab

@@ -0,0 +1,4 @@
+# for nginx user
+0 1 * * * cd /var/www/twong && php think maintain prod
+0 0 * * * cd /var/www/twong && php think maintain robot_reset
+*/20 * * * * cd /var/www/twong && php think maintain robot_order

+ 44 - 0
docs/nginx.conf

@@ -0,0 +1,44 @@
+# debian 9
+server {
+    listen 80;
+    server_name 0.0.0.0;
+
+    root /opt/www/twong/public
+    index index.php index.html;
+
+    location ^~ /mobilex/ {
+        alias /opt/www/twong/public/mobilex/;
+    }
+
+    # api
+    location / {
+        if (!-e $request_filename){
+            rewrite ^(.*)$ /index.php?s=$1 last;
+            break;
+        }
+    }
+
+    # php
+    location ~ \.php {
+        include fastcgi.conf;
+        fastcgi_pass unix:/run/php/php7.2-fpm.sock;
+    }
+
+}
+
+server {
+    listen 443 ssl;
+
+    ssl on;
+    ssl_certificate /etc/letsenrypt/live/***;
+    ssl_certificate_key /etc/letsencrypt/live/***;
+
+    server_name *.com;
+    server_tokens off;
+
+    include /etc/letsencrypt/options-ssl-nginx.conf;
+
+    location / {
+        proxy_pass http://127.0.0.1:80;
+    }
+}