• This forum has a zero tolerance policy regarding spam. If you register here to publish advertising, your user account will be deleted without further questions.

Zweiter Server Name für nginx / ubuntu 20.04

lpark

New Member
EDIT: Das Problem scheint zu sein, dass ich einen zweiten Server Namen benötige. Der unter /etc/hosts spezifizierte wird für die Nginx Vue Conf benutzt. Wie lege ich einen zweiten Server Namen an? benutzt ich localhost als server_name erhalte ich verständlicherweise nur Fehler, sobald ich von außerhalb darauf zugreife.

_____________________________________________________________________________________________________________________________
Ich versuche https mit selbst-signierten Zertifikaten einzurichten (nginx mit Vue / node.js).

Die vue.config habe ich angepasst:

module.exports = {
baseUrl: './',
devServer: {
port: 8080,
https: true,
disableHostCheck: true
}
};

Unter sites-available/enabled habe ich zwei config files für nginx angelegt:

VUE:

server {
listen 80;
listen [::]:80;
server_name inf-education-47.umwelt-campus.de;
return 301 https://$server_name$request_uri;
}
server {
listen 443 ssl http2;
listen [::]:443 ssl http2;
server_name inf-education-47.umwelt-campus.de;

# point to ssl certificate path
include snippets/self-signed.conf;
include snippets/ssl-params.conf;

location / {
# point to dist folder inside vue source code folder
root /var/www/client/pvapp-client/dist;
autoindex on;
autoindex_exact_size off;
index index.html index.htm;
try_files $uri $uri/ /index.html;
}
}


NODE:

server{
listen 80;
listen [::]:80;
#server_name localhost;
server_name ZweiterServerName;
return 301 https://$server_name$request_uri;
}

server {
listen 443 ssl;
listen [::]:443 ssl http2;
#server_name localhost;
server_name ZweiterServerName;

# point to ssl certificate path
include snippets/bcknd/self-signed.conf;
include snippets/bcknd/ssl-params-bck.conf;
root /var/www/server/pvapp-server;

location / {
proxy_pass http://localhost:60702;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
proxy_ssl_verify off;
}
}
 
Last edited:
Back
Top