This shows you the differences between two versions of the page.
Both sides previous revision Previous revision | |||
how_to_run_litecart_on_nginx [2019/02/10 04:34] 90.230.2.167 [Turn CentOS into a LEMP Server (May contain errors)] |
how_to_run_litecart_on_nginx [2019/02/10 04:40] (current) admin |
||
---|---|---|---|
Line 5: | Line 5: | ||
<code> | <code> | ||
server { | server { | ||
- | server_name litecart.local; | + | listen 80; |
- | + | server_name mydomain.tld; | |
- | listen 80; | + | return 301 http://www.mydomain.tld$request_uri; |
- | | + | } |
+ | |||
+ | server { | ||
+ | listen 80; | ||
+ | server_name www.mydomain.tld; | ||
+ | | ||
#listen 443 ssl; | #listen 443 ssl; | ||
#ssl_certificate www.example.com.crt; | #ssl_certificate www.example.com.crt; | ||
Line 17: | Line 22: | ||
index index.php index.html index.htm; | index index.php index.html index.htm; | ||
- | error_page 401 "Access Forbidden"; | + | error_page 401 "Access Forbidden"; |
- | error_page 403 /error_document?code=403; | + | error_page 403 /error_document?code=403; |
- | error_page 404 /error_document?code=404; | + | error_page 404 /error_document?code=404; |
- | error_page 410 /error_document?code=410; | + | error_page 410 /error_document?code=410; |
- | error_page 500 "Internal Server Error"; | + | error_page 500 "Internal Server Error"; |
| | ||
location ~* \.(eot|gif|ico|jpg|jpeg|otf|pdf|png|svg|ttf|woff|woff2)$ { | location ~* \.(eot|gif|ico|jpg|jpeg|otf|pdf|png|svg|ttf|woff|woff2)$ { | ||
- | expires 7d; | + | expires 7d; |
- | add_header Vary Accept-Encoding; | + | add_header Vary Accept-Encoding; |
- | access_log off; | + | access_log off; |
} | } | ||
| | ||
location ~* \.(css|js)$ { | location ~* \.(css|js)$ { | ||
- | expires 1d; | + | expires 1d; |
- | add_header Vary Accept-Encoding; | + | add_header Vary Accept-Encoding; |
- | access_log off; | + | access_log off; |
} | } | ||