linux:nginx
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
linux:nginx [2014/07/11 01:52] – external edit 127.0.0.1 | linux:nginx [2016/05/05 13:07] (current) – external edit 127.0.0.1 | ||
---|---|---|---|
Line 70: | Line 70: | ||
} | } | ||
+ | </ | ||
+ | |||
+ | |||
+ | ===== nginx all https ===== | ||
+ | To enable redirect all the http request to https | ||
+ | rewrite ^(.*) https:// | ||
+ | ==== generate the ssl certificate ==== | ||
+ | |||
+ | mkdir / | ||
+ | sudo openssl req -x509 -nodes -days 3650 -newkey rsa:2048 -keyout / | ||
+ | |||
+ | |||
+ | <code file=proxy.pjq.me.conf> | ||
+ | server { | ||
+ | listen 80; | ||
+ | root / | ||
+ | index index.html index.htm index.php; | ||
+ | server_name | ||
+ | rewrite ^(.*) https:// | ||
+ | location / { | ||
+ | try_files $uri $uri/ =404; | ||
+ | autoindex on; | ||
+ | } | ||
+ | location ~ \.php$ { | ||
+ | fastcgi_split_path_info ^(.+\.php)(/ | ||
+ | fastcgi_pass unix:/ | ||
+ | fastcgi_index index.php; | ||
+ | include fastcgi_params; | ||
+ | } | ||
+ | } | ||
+ | server { | ||
+ | listen 443 ssl; | ||
+ | root / | ||
+ | index index.html index.htm index.php; | ||
+ | server_name | ||
+ | ssl_certificate / | ||
+ | ssl_certificate_key / | ||
+ | location / { | ||
+ | try_files $uri $uri/ =404; | ||
+ | autoindex on; | ||
+ | } | ||
+ | location ~ \.php$ { | ||
+ | fastcgi_split_path_info ^(.+\.php)(/ | ||
+ | fastcgi_pass unix:/ | ||
+ | fastcgi_index index.php; | ||
+ | include fastcgi_params; | ||
+ | } | ||
+ | } | ||
</ | </ | ||
/var/www/dokuwiki/wiki/data/attic/linux/nginx.1405014776.txt.gz · Last modified: 2016/05/05 13:06 (external edit)