Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
public:computer:oracle_cloud [2022/03/22 16:29] – alex | public:computer:oracle_cloud [2022/04/01 11:04] (current) – [Nginx] alex | ||
---|---|---|---|
Line 175: | Line 175: | ||
</ | </ | ||
+ | <cli> | ||
+ | # sudo fuser -k 80/tcp | ||
+ | </ | ||
+ | |||
+ | * create .conf file: / | ||
+ | <sxh> | ||
+ | server | ||
+ | { | ||
+ | # | ||
+ | root / | ||
+ | index index.php; | ||
+ | |||
+ | location / { try_files $uri $uri/ @dokuwiki; } | ||
+ | |||
+ | location @dokuwiki | ||
+ | { | ||
+ | rewrite ^/ | ||
+ | rewrite ^/ | ||
+ | rewrite ^/ | ||
+ | rewrite ^/(.*) / | ||
+ | } | ||
+ | |||
+ | location ~ \.php$ | ||
+ | { | ||
+ | if (!-f $request_filename) { return 404; } | ||
+ | include fastcgi_params; | ||
+ | fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; | ||
+ | fastcgi_param REDIRECT_STATUS 200; | ||
+ | fastcgi_pass unix:/ | ||
+ | } | ||
+ | |||
+ | location ~ / | ||
+ | { | ||
+ | deny all; | ||
+ | } | ||
+ | |||
+ | location ~ / | ||
+ | { | ||
+ | internal; | ||
+ | } | ||
+ | |||
+ | # | ||
+ | } | ||
+ | </ | ||
=== etc === | === etc === | ||
* version | * version | ||
Line 193: | Line 237: | ||
# sudo apt install net-tools | # sudo apt install net-tools | ||
</ | </ | ||
+ | |||
+ | * force ssl | ||
+ | <sxh title:/ | ||
+ | # / | ||
+ | |||
+ | location ^~ / | ||
+ | allow all; | ||
+ | root / | ||
+ | default_type " | ||
+ | try_files $uri =404; | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | <sxh title:/ | ||
+ | server { | ||
+ | listen 80; | ||
+ | server_name wiki.theta5912.com; | ||
+ | #root / | ||
+ | |||
+ | include snippets/ | ||
+ | return 301 https:// | ||
+ | } | ||
+ | |||
+ | server { | ||
+ | # listen 80; | ||
+ | listen 443 ssl; | ||
+ | listen [::]:443 ssl; | ||
+ | |||
+ | server_name wiki.theta5912.com; | ||
+ | # ssl on; | ||
+ | |||
+ | ssl_certificate / | ||
+ | ssl_certificate_key / | ||
+ | |||
+ | root / | ||
+ | index index.php index.html index.html; | ||
+ | |||
+ | location / { | ||
+ | try_files $uri $uri/ @dokuwiki; | ||
+ | } | ||
+ | |||
+ | location @dokuwiki { | ||
+ | rewrite ^/ | ||
+ | rewrite ^/ | ||
+ | rewrite ^/ | ||
+ | rewrite ^/(.*) / | ||
+ | } | ||
+ | |||
+ | location ~ \.php$ { | ||
+ | # Caution: be sure the php7.2-fpm.sock matches your version | ||
+ | include snippets/ | ||
+ | fastcgi_pass unix:/ | ||
+ | fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; | ||
+ | include fastcgi_params; | ||
+ | } | ||
+ | |||
+ | location ~ / | ||
+ | deny all; | ||
+ | } | ||
+ | |||
+ | } | ||
+ | | ||
+ | </ | ||
==== < | ==== < |