- 通知
【重大更新】MCOI 站起来了! 注意,更新已回退
- 2023-2-2 9:03:49 @
因为之前有人反馈 MCOI 的音乐断断续续,然而我又是音乐功能的开发者,这显然不能忍,再三考虑之后,我果断的 sudo pm2 stop caddy
然后反手就 sudo apt-get install nginx -y
之后在 vim /var/www/html/index.html
然后输入了
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta id="viewport" name="viewport" content="width=device-width,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no">
<title>MCOI</title>
<style>
html,body,iframe{width: 100%;height: 100%;padding: 0;margin: 0}
#wrap{width: 100%;height: 100%;}
iframe{border: none;}
</style>
<link rel="apple-touch-icon" sizes="180x180" href="http://43.139.175.183:8888/apple-touch-icon-180x180.png">
<link rel="icon" type="image/png" href="http://43.139.175.183:8888/favicon-32x32.png" sizes="32x32">
<link rel="icon" type="image/png" href="http://43.139.175.183:8888/android-chrome-192x192.png" sizes="192x192">
<link rel="icon" type="image/png" href="http://43.139.175.183:8888/favicon-96x96.png" sizes="96x96">
<link rel="icon" type="image/png" href="http://43.139.175.183:8888/favicon-16x16.png" sizes="16x16">
</head>
<body>
<iframe src="http://43.139.175.183:8888/"></iframe>
<audio loop id="BGM-Player" controls="controls" preload="auto">
<script>var myAudio=document.getElementById("BGM-Player");if(myAudio. canPlayType("audio/mpeg")!=""){myAudio.src="https://ghproxy.com/https://github.com/Lixuannan/mcoi-audio/releases/download/deploy/mcoi-audio-all.mp3"}else if(myAudio.canPlayType("audio/ogg") != ""){myAudio.src="https://ghproxy.com/https://github.com/Lixuannan/mcoi-audio/releases/download/deploy/mcoi-audio-all.ogg"};</script>
</body>
</html>
然后修改了 nginx 的配置文件 (/etc/nginx/nginx.conf
)为:
user www-data;
worker_processes auto;
pid /run/nginx.pid;
include /etc/nginx/modules-enabled/*.conf;
events {
worker_connections 768;
# multi_accept on;
}
http {
##
# Basic Settings
##
sendfile on;
tcp_nopush on;
types_hash_max_size 2048;
# server_tokens off;
# server_names_hash_bucket_size 64;
# server_name_in_redirect off;
include /etc/nginx/mime.types;
default_type application/octet-stream;
##
# SSL Settings
##
ssl_protocols TLSv1 TLSv1.1 TLSv1.2 TLSv1.3; # Dropping SSLv3, ref: POODLE
ssl_prefer_server_ciphers on;
##
# Logging Settings
##
access_log /var/log/nginx/access.log;
error_log /var/log/nginx/error.log;
##
# Gzip Settings
##
gzip on;
# gzip_vary on;
# gzip_proxied any;
# gzip_comp_level 6;
# gzip_buffers 16 8k;
# gzip_http_version 1.1;
# gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript;
##
# Virtual Host Configs
##
include /etc/nginx/conf.d/*.conf;
include /etc/nginx/sites-enabled/*;
server {
listen 80;
root /var/www/html;
}
}
#mail {
# # See sample authentication script at:
# # http://wiki.nginx.org/ImapAuthenticateWithApachePhpScript
#
# # auth_http localhost/auth.php;
# # pop3_capabilities "TOP" "USER";
# # imap_capabilities "IMAP4rev1" "UIDPLUS";
#
# server {
# listen localhost:110;
# protocol pop3;
# proxy on;
# }
#
# server {
# listen localhost:143;
# protocol imap;
# proxy on;
# }
#
最后
sudo nginx -t
sudo nginx -s reload
然后以后 MCOI 就可以随心所欲的加功能了,万岁!!!
12 条评论
-
WTX 赞助!万岁! LV 6 SU @ 2023-2-4 19:53:45
其实我一开始也想用N只因x来做网站,但是服务器只有一个
-
2023-2-4 9:34:12@
回到以前把,我先给这个备个份
-
2023-2-3 13:33:16@
界面感觉不如以前的好了
-
2023-2-3 13:33:04@
我感觉加了音乐之后整个网站都怪怪的
-
2023-2-3 13:30:29@
我加个端口转发啊
-
2023-2-3 13:30:16@
《不过反向解决了caddy和nginx冲突的问题》
-
2023-2-3 13:29:45@
我虚拟机试一下改server,port试一下
-
2023-2-3 13:27:21@
我shitshit你啊
-
2023-2-3 13:27:12@
我他妈头像都废了
-
2023-2-3 13:27:05@
我靠你这是让我把所有网址都加上:8888是吧
-
2023-2-2 21:06:07@
为啥训练和作业又回来了
-
2023-2-2 10:31:01@
补充一下,如果大家在使用过程中遇到 404 可以尝试在链接上加上
:8888
例:http://43.139.175.183/discuss
->http://43.139.175.183:8888/discuss
- 1