LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 05-28-2021, 07:54 PM   #1
errigour
Member
 
Registered: May 2009
Posts: 305

Rep: Reputation: 6
nginx and javascript log in webpage without mysql


Hi I have a directory disabled with nginx but i want to be able to use javascript to write to files in it without visitors to my webpage to be able to spoof and read the password files is that even possible with javascript?

like i have a directory www with files index.html and a directory called data.
so
www
www/index.html
www/data/password.db

data directory is offlimits to outside users but i want to use javascript to write to password.db without people spoofing javascript, i am uber new to javascript and nginx is it possible with nginx and javascript?

I basically want to write to a database that i dont want visible to anyone. and i dont want people to be able to modify my *.db files or anything in the data directory. I have no idea how to use mysql either but i want people to be able to log in and out of my webpage without their passwords being modified or veiwed by others.

this is my 00-default.conf file
Code:
server {
    listen 80 default_server;
    server_name localhost ;
    root "C:/laragon/www/";
    
    index index.html index.htm index.php;
 
    # Access Restrictions
    allow       127.0.0.1;
    deny        all;
 
    #include "C:/laragon/etc/nginx/alias/*.conf";

    location / {
        try_files $uri $uri/ =404;
		autoindex on;
    }
    
    location ~ \.php$ {
        include snippets/fastcgi-php.conf;
        fastcgi_pass php_upstream;		
        #fastcgi_pass unix:/run/php/php7.0-fpm.sock;
    }

	
    charset utf-8;
	
    location = /favicon.ico { access_log off; log_not_found off; }
    location = /robots.txt  { access_log off; log_not_found off; }
    location ~ /\.ht {
        deny all;
    }
	
    location ^~ /data/ { 
        deny all; 
    }
	
}
 
Old 05-28-2021, 08:18 PM   #2
errigour
Member
 
Registered: May 2009
Posts: 305

Original Poster
Rep: Reputation: 6
is it even possible?
 
Old 05-28-2021, 10:37 PM   #3
errigour
Member
 
Registered: May 2009
Posts: 305

Original Poster
Rep: Reputation: 6
sorry i wish i could delete this post i think i found out its impossible anyways sorry to waste your time maybe i have to use php to access files because its server side.
 
Old 05-29-2021, 07:06 AM   #4
boughtonp
Senior Member
 
Registered: Feb 2007
Location: UK
Distribution: Debian
Posts: 1,339

Rep: Reputation: 1133Reputation: 1133Reputation: 1133Reputation: 1133Reputation: 1133Reputation: 1133Reputation: 1133Reputation: 1133Reputation: 1133
Quote:
Originally Posted by errigour View Post
sorry i wish i could delete this post i think i found out its impossible anyways sorry to waste your time maybe i have to use php to access files because its server side.
You can report posts/threads to moderators, but simpler is just use Thread Tools to mark it as solved.

Also, PHP is one option but there are other server-side languages. (Some people even use server-side JavaScript, via NodeJS, personally I don't recommend that.)

Whatever you use, properly learning the difference between client-side and server-side - and how data traverses between them (i.e. HTTP Requests and Responses) - is one of the most useful things any web developer can learn, and yet so many never do (or only have an incomplete/superficial understanding).

 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to log internal-sftp chroot jailed users access log to /var/log/sftp.log file LittleMaster Linux - Server 0 09-04-2018 03:45 PM
[SOLVED] after installation of MySQL could not log into mysql using temporary password in /var/log/mysqld.log User247 Linux - Server 2 12-25-2017 09:31 AM
Nginx, Horde, Https, Redirect, This webpage has a redirect loop axetone Ubuntu 0 02-08-2015 10:44 PM
webpage in webpage? kalleanka Programming 6 06-07-2009 04:13 PM
Can MySQL log on via SSH/bash? mysql:x:27:101:MySQL Server:/var/lib/mysql:/bin/bash Ujjain Linux - Newbie 2 04-24-2009 02:21 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 12:49 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration