有同学其实习访问不了校园网,把校园网的系统通过反向代理到ubuntu系统后用frp映射到公网
安装nginx后,配置写入以下
10.2.2.195/fims/是内网地址
user www-data;
worker_processes auto;
pid /run/nginx.pid;
include /etc/nginx/modules-enabled/*.conf;
events {
worker_connections 768;
}
http {
##
# Basic Settings
##
sendfile on;
tcp_nopush on;
types_hash_max_size 2048;
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;
##
# Virtual Host Configs
##
server {
listen 8098 default_server; # 采用哪个端口打开 Web1
listen [::]:8098 default_server;
server_name web1;
location / {
proxy_pass http://10.2.2.195/fims/; # Web1在局域网内的 IP 路径,反向代理就是这里配置
}
}
}