mirror of
https://github.com/certbot/certbot.git
synced 2026-06-08 16:22:18 -04:00
33 lines
580 B
Nginx Configuration File
33 lines
580 B
Nginx Configuration File
upstream app_server {
|
|
server 0.0.0.0:3000;
|
|
}
|
|
|
|
server {
|
|
listen 80;
|
|
server_name www.mysite.com;
|
|
|
|
root /path/to/main_site;
|
|
# ...
|
|
|
|
location / {
|
|
proxy_set_header X-Real-IP $remote_addr;
|
|
# ...
|
|
|
|
if ($http_user_agent ~* '(iPhone|iPod)') {
|
|
set $iphone_request '1';
|
|
}
|
|
if ($http_cookie ~ 'iphone_mode=full') {
|
|
set $iphone_request '';
|
|
}
|
|
if ($iphone_request = '1') {
|
|
rewrite ^.+ http://m.mysite.com$uri;
|
|
}
|
|
|
|
# serve cached pages ...
|
|
|
|
if (!-f $request_filename) {
|
|
proxy_pass http://app_server;
|
|
break;
|
|
}
|
|
}
|
|
}
|