defget_full_path(path): if os.path.isabs(path): return path # 尝试对相对路径进行查找 # 查找当前目录 t = os.path.abspath(path) if os.path.exists(t): return t # 查找启动脚本所在目录 main_path = os.path.abspath(sys.argv[0]) t, _ = os.path.split(main_path) t = os.path.join(t, path) if os.path.exists(t): return t # 查找当前脚本所在目录 script_path = os.path.realpath(__file__) t, _ = os.path.split(script_path) t = os.path.join(t, path) if os.path.exists(t): return t raise FileNotFoundError(f"Can NOT find '{path}'.")
defaddClassPath(self, path): if path: ifisinstance(path, list) orisinstance(path, tuple): for e in path: jpype.addClassPath(get_full_path(e)) else: jpype.addClassPath(get_full_path(path))
... # Default server configuration # server { listen 80 default_server; listen [::]:80 default_server; ... root /var/www/html;
# Add index.php to the list if you are using PHP index index.html index.htm index.nginx-debian.html;
server_name _;
location / { # First attempt to serve request as file, then # as directory, then fall back to displaying a 404. try_files $uri $uri/ =404; } ... }
# Virtual Host configuration for example.com # # You can move that to a different file under sites-available/ and symlink that # to sites-enabled/ to enable it. # #server { # listen 80; # listen [::]:80; # # server_name example.com; # # root /var/www/example.com; # index index.html; # # location / { # try_files $uri $uri/ =404; # } #}
server { listen 172.19.64.114:80; server_name kyo86.com www.kyo86.com; root /var/www/hexo;
index index.html index.htm; location / { # First attempt to serve request as file, then # as directory, then fall back to displaying a 404. try_files $uri $uri/ =404; } }