server {
    listen       80;
    listen  [::]:80;
    server_name  localhost;

    location / {
        root   /simsFE;
        index  index.html index.htm;
    }
	location /student/ {
	    proxy_http_version 1.1;
	    proxy_set_header Upgrade $http_upgrade;
	    proxy_set_header Connection "upgrade";
	    proxy_set_header X-Nginx-Proxy true;
	    proxy_set_header Host $host:$server_port;
	    proxy_set_header X-Forwarded-Proto $scheme; 
	    proxy_set_header X-Real-IP $remote_addr;
	    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
	    proxy_pass http://simsbe:8000/student/;
	}
	location /students/ {
	    proxy_http_version 1.1;
	    proxy_set_header Upgrade $http_upgrade;
	    proxy_set_header Connection "upgrade";
	    proxy_set_header X-Nginx-Proxy true;
	    proxy_set_header Host $host:$server_port;
	    proxy_set_header X-Forwarded-Proto $scheme; 
	    proxy_set_header X-Real-IP $remote_addr;
	    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
	    proxy_pass http://simsbe:8000/students/;
	}
	location /sno/ {
	    proxy_http_version 1.1;
	    proxy_set_header Upgrade $http_upgrade;
	    proxy_set_header Connection "upgrade";
	    proxy_set_header X-Nginx-Proxy true;
	    proxy_set_header Host $host:$server_port;
	    proxy_set_header X-Forwarded-Proto $scheme; 
	    proxy_set_header X-Real-IP $remote_addr;
	    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
	    proxy_pass http://simsbe:8000/sno/;
	}
	location /upload/ {
	    client_max_body_size 20m; # 设置上传文件的最大大小为 20MB
	    proxy_http_version 1.1;
	    proxy_set_header Upgrade $http_upgrade;
	    proxy_set_header Connection "upgrade";
	    proxy_set_header X-Nginx-Proxy true;
	    proxy_set_header Host $host:$server_port;
	    proxy_set_header X-Forwarded-Proto $scheme; 
	    proxy_set_header X-Real-IP $remote_addr;
	    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
	    proxy_pass http://simsbe:8000/upload/;
	}
	location /media/ {
	    proxy_http_version 1.1;
	    proxy_set_header Upgrade $http_upgrade;
	    proxy_set_header Connection "upgrade";
	    proxy_set_header X-Nginx-Proxy true;
	    proxy_set_header Host $host:$server_port;
	    proxy_set_header X-Forwarded-Proto $scheme; 
	    proxy_set_header X-Real-IP $remote_addr;
	    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
	    proxy_pass http://simsbe:8000/media/;
	}
	location /excel/ {
	    client_max_body_size 20m; # 设置上传文件的最大大小为 20MB
	    proxy_http_version 1.1;
	    proxy_set_header Upgrade $http_upgrade;
	    proxy_set_header Connection "upgrade";
	    proxy_set_header X-Nginx-Proxy true;
	    proxy_set_header Host $host:$server_port;
	    proxy_set_header X-Forwarded-Proto $scheme; 
	    proxy_set_header X-Real-IP $remote_addr;
	    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
	    proxy_pass http://simsbe:8000/excel/;
	}
}

