美好的一天!
我有一个与MyBBconfiguration的论坛。 一切都在Ubuntu 14.04上运行,但我的朋友试图安装16.04上,并保存了一切(网站的configuration,letsencrypt文件,网站的文件,数据库转储等)。 他本可以做sudo do-release-upgrade
,但是不行,他更喜欢备份所有东西并做一个干净的安装。
事情是我现在的任务是把所有的东西,现在与一个sudo nginx -t
我得到这个语法错误:
nginx: [emerg] no port in upstream "memcached" in /etc/nginx/sites-enabled/forum.example.com:54
检查第54行上面的内容,我看到"$scheme://$host$request_uri"
,它必须先前已经在nginx.conf文件中configuration好了,他忘记了备份。
我有一个memcached服务器,我不知道如何/在哪里声明它。 它在nginx,conf或者在站点的.conf文件中?
让我知道。
这是剩下的configuration。 那里还有其他的东西吗?
提前致谢。
温暖的问候。
server { listen 80; server_name forum.example.com; return 301 https://$server_name$request_uri; } server { listen 443 ssl; server_name forum.example.com; location ~ \.css { add_header Content-Type text/css; } location ~ \.js { add_header Content-Type application/x-javascript; } root /usr/share/nginx/html/forum; ssl on; ssl_certificate /etc/letsencrypt/live/forum.example.com/fullchain.pem; ssl_certificate_key /etc/letsencrypt/live/forum.example.com/privkey.pem; ssl_session_timeout 5m; ssl_ciphers 'AES128+EECDH:AES128+EDH:!aNULL'; ssl_protocols TLSv1 TLSv1.1 TLSv1.2; ssl_prefer_server_ciphers on; access_log /var/log/nginx/access-forum.log; error_log /var/log/nginx/error-forum.log; client_max_body_size 10m; add_header X-Frame-Options "SAMEORIGIN"; add_header X-XSS-Protection "1; mode=block"; add_header X-Robots-Tag none; add_header X-Download-Options noopen; add_header X-Permitted-Cross-Domain-Policies none; add_header Strict-Transport-Security "max-age=31536000; includeSubDomains"; location / { index index.php index.htm index.html; try_files $uri $uri/ /index.php?q=$uri&$args; } location ~ \.php$ { set $memcached_key "$scheme://$host$request_uri"; memcached_pass memcached; default_type text/html; error_page 404 405 502 = @cache_miss; } location @cache_miss { if (!-f $request_filename) { return 404; } fastcgi_pass unix:/var/run/php/php7.0-fpm.sock; include fastcgi_params; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_read_timeout 300; } location = /memcache.php { if (!-f $request_filename) { return 404; } fastcgi_pass unix:/var/run/php/php7.0-fpm.sock; include fastcgi_params; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_read_timeout 300; } }